search for: exp_keepnul

Displaying 2 results from an estimated 2 matches for "exp_keepnul".

2020 Mar 28
0
[klibc:update-dash] dash: expand: Merge syntax/quotes in memtodest with flags
...ain it outside of the function at all. The only place that uses something other than BASESYNTAX or DQSYNTAX is exptilde. However in that case DQSYNTAX has exactly the same effect as SQSYNTAX. This patch merges these two arguments into a single flags. The macro QUOTES_KEEPNUL has been renamed to EXP_KEEPNUL in order to keep the namespace separate. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/expand.c | 42 +++++++++++++++++------------------------- usr/dash/expand.h | 1 + 2 files changed, 18 insertions(+)...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...E; - int discard = subtype == VSPLUS || subtype == VSLENGTH; + int discard = (subtype == VSPLUS || subtype == VSLENGTH) | + (flags & EXP_DISCARD); ssize_t len = 0; char c; + if (!subtype) { + if (discard) + return -1; + + sh_error("Bad substitution"); + } + flags |= EXP_KEEPNUL; flags &= discard ? ~QUOTES_ESC : ~0; sep = (flags & EXP_FULL) << CHAR_BIT; @@ -979,6 +949,7 @@ value: if (discard) STADJUST(-len, expdest); + return len; } @@ -1730,7 +1701,6 @@ casematch(union node *pattern, char *val) argbackq = pattern->narg.backquote; START...