klibc-bot for Herbert Xu
2020-Mar-28 21:48 UTC
[klibc] [klibc:update-dash] dash: [BUILTIN] Handle -- in dotcmd
Commit-ID: 6297d755e71777d4fcf55d106d11f9e631fa547f Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=6297d755e71777d4fcf55d106d11f9e631fa547f Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Mon, 27 Oct 2014 16:56:46 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: [BUILTIN] Handle -- in dotcmd [ dash commit 12ad48bb31b003eb6d3106478b7760a031969a36 ] This patch adds a nextopt call in dotcmd in order to handle --. Reported-by: Stephane Chazelas <stephane_chazelas at yahoo.fr> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr/dash/main.c b/usr/dash/main.c index 00c5e00d..985e8c4e 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -321,15 +321,19 @@ dotcmd(int argc, char **argv) { int status = 0; - if (argc >= 2) { /* That's what SVR2 does */ + nextopt(nullstr); + argv = argptr; + + if (*argv) { char *fullname; - fullname = find_dot_file(argv[1]); + fullname = find_dot_file(*argv); setinputfile(fullname, INPUT_PUSH_FILE); commandname = fullname; status = cmdloop(0); popfile(); } + return status; }
Possibly Parallel Threads
- [klibc:update-dash] [BUILTIN] Handle -- in dotcmd
- [klibc:master] [BUILTIN] Merge SKIPFUNC/ SKIPFILE and only clear SKIPFUNC when leaving dotcmd
- [klibc:update-dash] dash: eval: Reset handler when entering a subshell
- [klibc:update-dash] dash: exec: Stricter pathopt parsing
- [git patch] klibc dash 0.5.4 update