diff options
author | grehan <grehan@FreeBSD.org> | 2011-06-28 06:26:03 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2011-06-28 06:26:03 +0000 |
commit | 2c6741be0f59191f2283eb268e4f7690399d578a (patch) | |
tree | b139c8c6dcca4fa284815daade405b75886ee360 /bin/sh/options.c | |
parent | 3c35264f695e0a1f8a04dbcca1c93bb5159b2274 (diff) | |
parent | 19ae02bba572390c7299166228d31e54003e094a (diff) | |
download | FreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.zip FreeBSD-src-2c6741be0f59191f2283eb268e4f7690399d578a.tar.gz |
IFC @ r222830
Diffstat (limited to 'bin/sh/options.c')
-rw-r--r-- | bin/sh/options.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/sh/options.c b/bin/sh/options.c index a99fe81..9104e93 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include "memalloc.h" #include "error.h" #include "mystring.h" +#include "builtins.h" #ifndef NO_HISTORY #include "myhistedit.h" #endif @@ -83,6 +84,7 @@ void procargs(int argc, char **argv) { int i; + char *scriptname; argptr = argv; if (argc > 0) @@ -105,8 +107,9 @@ procargs(int argc, char **argv) optlist[i].val = 0; arg0 = argv[0]; if (sflag == 0 && minusc == NULL) { - commandname = arg0 = *argptr++; - setinputfile(commandname, 0); + scriptname = *argptr++; + setinputfile(scriptname, 0); + commandname = arg0 = scriptname; } /* POSIX 1003.2: first arg after -c cmd is $0, remainder $1... */ if (argptr && minusc && *argptr) |