diff options
author | Rob Landley <rob@landley.net> | 2020-11-27 06:37:48 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-11-27 06:37:48 -0600 |
commit | 66f9027e9c3b3c8410dc45036b31a0b93e93e8a6 (patch) | |
tree | 3a68f328a3da5acbba6274da3380a71a7c129717 | |
parent | a52f04319843de7c88476a78d6f6f48ef4e02e12 (diff) | |
download | toybox-66f9027e9c3b3c8410dc45036b31a0b93e93e8a6.tar.gz |
toysh: Adjust $0 for scripts.
-rw-r--r-- | toys/pending/sh.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 21143199..82d9ad32 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -3105,7 +3105,6 @@ int do_source(char *name, FILE *ff) TT.lineno = TT.shift = 0; memset(&scratch, 0, sizeof(scratch)); - // TODO: factor out and combine with sh_main() plumbing? do { new = prompt_getline(ff, more+1); if (!TT.lineno++ && new && !memcmp(new, "\177ELF", 4)) { @@ -3274,7 +3273,8 @@ void sh_main(void) if (!FLAG(c)) { if (toys.optc==1) toys.optflags |= FLAG_s; if (FLAG(s) && isatty(0)) toys.optflags |= FLAG_i; - } else if (toys.optc>1) { + } + if (toys.optc>1) { toys.optargs++; toys.optc--; } |