aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatthoyts <patthoyts>2005-04-13 19:50:18 +0000
committerpatthoyts <patthoyts>2005-04-13 19:50:18 +0000
commitf6d451dab00e04149b8d267bc24b5d46c03d346c (patch)
treede05327f296bcd6b77cfbc03e485fc15e150a88a
parent594664e0ec9753f5ab33754a9ad5660478063a6c (diff)
downloadjimtcl-f6d451dab00e04149b8d267bc24b5d46c03d346c.zip
jimtcl-f6d451dab00e04149b8d267bc24b5d46c03d346c.tar.gz
jimtcl-f6d451dab00e04149b8d267bc24b5d46c03d346c.tar.bz2
JimGetExePath needs to be a _path_ not the file name.
-rw-r--r--jimsh.c6
1 files 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 <antirez@invece.org>
*
- * $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 */