search for: nextopt

Displaying 7 results from an estimated 7 matches for "nextopt".

Did you mean: netopt
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle -- in dotcmd
...f66c01eed24475a140d934b7a75b28d23e 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: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [BUILTIN] Handle -- in dotcmd 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(+...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle -- in dotcmd
...rbert 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(+...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Small optimisation of command -pv change
...tblentry *cmdp; const struct alias *ap; + path = path ?: pathval(); + if (verbose) { outstr(command, out); } @@ -840,19 +842,19 @@ commandcmd(argc, argv) VERIFY_BRIEF = 1, VERIFY_VERBOSE = 2, } verify = 0; - const char *path = pathval(); + const char *path = NULL; while ((c = nextopt("pvV")) != '\0') if (c == 'V') verify |= VERIFY_VERBOSE; else if (c == 'v') verify |= VERIFY_BRIEF; - else if (c == 'p') - path = defpath; #ifdef DEBUG - else + else if (c != 'p') abort(); #endif + else + path = defpath;...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Small optimisation of command -pv change
...tblentry *cmdp; const struct alias *ap; + path = path ?: pathval(); + if (verbose) { outstr(command, out); } @@ -840,19 +842,19 @@ commandcmd(argc, argv) VERIFY_BRIEF = 1, VERIFY_VERBOSE = 2, } verify = 0; - const char *path = pathval(); + const char *path = NULL; while ((c = nextopt("pvV")) != '\0') if (c == 'V') verify |= VERIFY_VERBOSE; else if (c == 'v') verify |= VERIFY_BRIEF; - else if (c == 'p') - path = defpath; #ifdef DEBUG - else + else if (c != 'p') abort(); #endif + else + path = defpath;...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] command: allow combining -p with -v
...uct cmdentry entry; struct tblentry *cmdp; const struct alias *ap; - const char *path = pathval(); if (verbose) { outstr(command, out); @@ -840,20 +840,23 @@ commandcmd(argc, argv) VERIFY_BRIEF = 1, VERIFY_VERBOSE = 2, } verify = 0; + const char *path = pathval(); while ((c = nextopt("pvV")) != '\0') if (c == 'V') verify |= VERIFY_VERBOSE; else if (c == 'v') verify |= VERIFY_BRIEF; + else if (c == 'p') + path = defpath; #ifdef DEBUG - else if (c != 'p') + else abort(); #endif cmd = *argptr; if (ver...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] command: allow combining -p with -v
...uct cmdentry entry; struct tblentry *cmdp; const struct alias *ap; - const char *path = pathval(); if (verbose) { outstr(command, out); @@ -840,20 +840,23 @@ commandcmd(argc, argv) VERIFY_BRIEF = 1, VERIFY_VERBOSE = 2, } verify = 0; + const char *path = pathval(); while ((c = nextopt("pvV")) != '\0') if (c == 'V') verify |= VERIFY_VERBOSE; else if (c == 'v') verify |= VERIFY_BRIEF; + else if (c == 'p') + path = defpath; #ifdef DEBUG - else if (c != 'p') + else abort(); #endif cmd = *argptr; if (ver...
2020 Mar 28
0
[klibc:update-dash] dash: exec: Stricter pathopt parsing
...tackto(qlen); + + if (likely(len)) { + q = mempcpy(q, start, len); + *q++ = '/'; } - if (*p == ':') - *path = p + 1; - else - *path = NULL; - return len; + strcpy(q, name); + + return qlen; } @@ -228,7 +273,7 @@ hashcmd(int argc, char **argv) char *name; while ((c = nextopt("r")) != '\0') { - clearcmdentry(0); + clearcmdentry(); return 0; } if (*argptr == NULL) { @@ -363,15 +408,16 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) idx = -1; loop: while ((len = padvance(&path, name)) >= 0) { + const c...