From f6d451dab00e04149b8d267bc24b5d46c03d346c Mon Sep 17 00:00:00 2001 From: patthoyts Date: Wed, 13 Apr 2005 19:50:18 +0000 Subject: JimGetExePath needs to be a _path_ not the file name. --- jimsh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jimsh.c b/jimsh.c index 58be4e8..ca11f67 100644 --- a/jimsh.c +++ b/jimsh.c @@ -1,7 +1,7 @@ /* Jimsh - An interactive shell for Jim * Copyright 2005 Salvatore Sanfilippo * - * $Id: jimsh.c,v 1.9 2005/04/11 08:25:36 antirez Exp $ + * $Id: jimsh.c,v 1.10 2005/04/13 19:50:18 patthoyts Exp $ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,10 +41,12 @@ #ifdef WIN32 static Jim_Obj *JimGetExePath(Jim_Interp *interp, const char *argv0) { - char path[MAX_PATH+1]; + char path[MAX_PATH+1], *p; JIM_NOTUSED(argv0); GetModuleFileNameA(NULL, path, MAX_PATH); + if ((p = strrchr(path, '\\')) != NULL) + *p = 0; return Jim_NewStringObj(interp, path, -1); } #else /* WIN32 */ -- cgit v1.1