search for: nulonly

Displaying 12 results from an estimated 12 matches for "nulonly".

2019 Jan 25
0
[klibc:update-dash] [EXPAND] Optimise nulonly away and just use quoted as before
...libc/klibc.git;a=commit;h=6e3f1aff00a97256e185897ac25d4d5b9ed5a4a5 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Wed, 8 Oct 2014 20:09:56 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [EXPAND] Optimise nulonly away and just use quoted as before This patch makes a small optimisation by using the same value for quoted between evalvar and varvalue by eliminating nulonly and passing along quoted instead. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben a...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Optimise nulonly away and just use quoted as before
...libc.git;a=commit;h=f253b53e6b2b89b31085e7d1e50f0eb6edf891dd Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Wed, 8 Oct 2014 20:09:56 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: [EXPAND] Optimise nulonly away and just use quoted as before [ dash commit ab657e36b68f4a7e9ddb0f36c455c98d1c069a2c ] This patch makes a small optimisation by using the same value for quoted between evalvar and varvalue by eliminating nulonly and passing along quoted instead. Signed-off-by: Herbert Xu <herbert at gond...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...t); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -722,6 +722,7 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; + int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -732,11 +733,12 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@' && shellparam.nparam)); + nulonly = easy; startloc = expdest - (char *)stackblock(); p = strch...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...t); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -722,6 +722,7 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; + int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -732,11 +733,12 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@' && shellparam.nparam)); + nulonly = easy; startloc = expdest - (char *)stackblock(); p = strch...
2019 Jan 25
0
[klibc:update-dash] expand: Fix bugs with words connected to the right of $@
...^= EXP_QUOTED; addquote: if (flag & QUOTES_ESC) { p--; @@ -1032,7 +1032,10 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist) realifs = ifsset() ? ifsval() : defifs; ifsp = &ifsfirst; do { + int afternul; + p = string + ifsp->begoff; + afternul = nulonly; nulonly = ifsp->nulonly; ifs = nulonly ? nullstr : realifs; ifsspc = 0; @@ -1097,7 +1100,7 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist) } if (isifs) { - if (!nulonly) + if (!(afternul || nulonly)) ifsspc = isdefifs; /* Ignore IFS...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix bugs with words connected to the right of $@
...^= EXP_QUOTED; addquote: if (flag & QUOTES_ESC) { p--; @@ -1032,7 +1032,10 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist) realifs = ifsset() ? ifsval() : defifs; ifsp = &ifsfirst; do { + int afternul; + p = string + ifsp->begoff; + afternul = nulonly; nulonly = ifsp->nulonly; ifs = nulonly ? nullstr : realifs; ifsspc = 0; @@ -1097,7 +1100,7 @@ ifsbreakup(char *string, int maxargs, struct arglist *arglist) } if (isifs) { - if (!nulonly) + if (!(afternul || nulonly)) ifsspc = isdefifs; /* Ignore IFS...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...investigate it. > > Looking into it again: > > When IFS is set to an empty string, sepc is set to '\0' in varvalue(). > This then causes *quotedp to be set to true, meaning evalvar()'s quoted > variable is turned on. quoted is then passed to recordregion() as the > nulonly parameter. > > ifsp->nulonly has a bigger effect than merely selecting whether to use > $IFS or whether to only split on null bytes: in ifsbreakup(), nulonly > also causes string termination to be suppressed. That's correct: that > special treatment is required to preserve emp...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...investigate it. > > Looking into it again: > > When IFS is set to an empty string, sepc is set to '\0' in varvalue(). > This then causes *quotedp to be set to true, meaning evalvar()'s quoted > variable is turned on. quoted is then passed to recordregion() as the > nulonly parameter. > > ifsp->nulonly has a bigger effect than merely selecting whether to use > $IFS or whether to only split on null bytes: in ifsbreakup(), nulonly > also causes string termination to be suppressed. That's correct: that > special treatment is required to preserve emp...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix handling of trailing IFS white spaces
...*arglist, int flag) * TODO - EXP_REDIR */ if (flag & EXP_FULL) { - ifsbreakup(p, &exparg); + ifsbreakup(p, -1, &exparg); *exparg.lastp = NULL; exparg.lastp = &exparg.list; expandmeta(exparg.list, flag); @@ -1016,15 +1017,18 @@ recordregion(int start, int end, int nulonly) * Break the argument string into pieces based upon IFS and add the * strings to the argument list. The regions of the string to be * searched for IFS characters have been stored by recordregion. + * If maxargs is non-negative, at most maxargs arguments will be created, by + * joining togeth...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix handling of trailing IFS white spaces
...*arglist, int flag) * TODO - EXP_REDIR */ if (flag & EXP_FULL) { - ifsbreakup(p, &exparg); + ifsbreakup(p, -1, &exparg); *exparg.lastp = NULL; exparg.lastp = &exparg.list; expandmeta(exparg.list, flag); @@ -1016,15 +1017,18 @@ recordregion(int start, int end, int nulonly) * Break the argument string into pieces based upon IFS and add the * strings to the argument list. The regions of the string to be * searched for IFS characters have been stored by recordregion. + * If maxargs is non-negative, at most maxargs arguments will be created, by + * joining togeth...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...s beyond + * start of variable + */ + removerecordregions(startloc); + goto again; } if (varlen < 0 && uflag) @@ -786,9 +780,9 @@ vsplus: } if (subtype == VSNORMAL) { +record: if (!easy) goto end; -record: recordregion(startloc, expdest - (char *)stackblock(), nulonly); goto end; }
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...s beyond + * start of variable + */ + removerecordregions(startloc); + goto again; } if (varlen < 0 && uflag) @@ -786,9 +780,9 @@ vsplus: } if (subtype == VSNORMAL) { +record: if (!easy) goto end; -record: recordregion(startloc, expdest - (char *)stackblock(), nulonly); goto end; }