aboutsummaryrefslogtreecommitdiff
path: root/jimsh.c
diff options
context:
space:
mode:
authorchi <chi>2005-04-10 17:04:12 +0000
committerchi <chi>2005-04-10 17:04:12 +0000
commita50382c0e7c7c5516ba2449fa3322ad3e6c775a9 (patch)
tree207a32ae36c519a4b9c020587d5c8866470c797c /jimsh.c
parent0212cfb56d1daa73e41bbc97e66058bd7ac04b5a (diff)
downloadjimtcl-a50382c0e7c7c5516ba2449fa3322ad3e6c775a9.zip
jimtcl-a50382c0e7c7c5516ba2449fa3322ad3e6c775a9.tar.gz
jimtcl-a50382c0e7c7c5516ba2449fa3322ad3e6c775a9.tar.bz2
Rework of the [scan] command finished. It does not any longer use
sscanf for scanning purposes, only for parsing within SetScanFmtFromAny. We could get rid of it there too, if necessary. It pass all tests on all platforms I had access to (mainly Linux, Solaris, FreeBSD, MacOS X). But I am confident, that it will pass on the others as well. A small new introduced C99-ism was fixed in jimsh.c as well.
Diffstat (limited to 'jimsh.c')
-rw-r--r--jimsh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/jimsh.c b/jimsh.c
index 617e86e..8da6726 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.7 2005/04/08 14:06:00 patthoyts Exp $
+ * $Id: jimsh.c,v 1.8 2005/04/10 17:04:13 chi Exp $
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,8 +57,9 @@ static Jim_Obj *JimGetExePath(Jim_Interp *interp, const char *argv0)
/* Check if the executable was called with an absolute pathname */
if (argv0[0] == '/') {
+ char *p;
strncpy(path, argv0, JIM_PATH_LEN);
- char *p = strrchr(path, '/');
+ p = strrchr(path, '/');
if (p != path)
*p = '\0';
return Jim_NewStringObj(interp, path, -1);