diff options
author | chi <chi> | 2005-04-10 17:04:12 +0000 |
---|---|---|
committer | chi <chi> | 2005-04-10 17:04:12 +0000 |
commit | a50382c0e7c7c5516ba2449fa3322ad3e6c775a9 (patch) | |
tree | 207a32ae36c519a4b9c020587d5c8866470c797c /jimsh.c | |
parent | 0212cfb56d1daa73e41bbc97e66058bd7ac04b5a (diff) | |
download | jimtcl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |