search for: cvtnum

Displaying 4 results from an estimated 4 matches for "cvtnum".

2020 Mar 28
0
[klibc:update-dash] dash: expand: Ensure result is escaped in cvtnum
...h=f74d60ab87269a10d5efadff1887a260783017dd Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Fri, 1 Jun 2018 18:25:29 +0800 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:55 +0000 [klibc] dash: expand: Ensure result is escaped in cvtnum [ dash commit 78a00a7471c059c9d7055f633c060106596de4fb ] The minus sign generated from arithmetic expansion is currently unquoted which causes anomalies when the result is used in where the quoting matters. This patch fixes it by explicitly calling memtodest on the result in cvtnum. Signed-off-...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Eat closing brace for length parameter expansion
...le changed, 1 insertion(+) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 25236c09..20362cef 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -745,6 +745,7 @@ again: varunset(p, var, 0, 0); if (subtype == VSLENGTH) { + p++; if (flag & EXP_DISCARD) return p; cvtnum(varlen > 0 ? varlen : 0, flag);
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix multiple issues with EXP_DISCARD in evalvar
...& EXP_DISCARD) + goto record; varflags &= ~VSNUL; + subtype = VSNORMAL; goto again; } - if (varlen < 0 && uflag) + if ((discard & ~flag) && uflag) varunset(p, var, 0, 0); if (subtype == VSLENGTH) { if (flag & EXP_DISCARD) return p; cvtnum(varlen > 0 ? varlen : 0, flag); - goto record; + goto really_record; } if (subtype == VSNORMAL) @@ -765,7 +766,7 @@ again: } #endif - flag |= varlen < 0 ? EXP_DISCARD : 0; + flag |= discard; if (!(flag & EXP_DISCARD)) { /* * Terminate the string and start recording t...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...= begoff; + STADJUST(start - expdest, expdest); removerecordregions(begoff); - expdest = p; - if (likely(flag & QUOTES_ESC)) - rmescapes(p + 1); + rmescapes(start); - result = arith(p + 1); + pushstackmark(&sm, endoff); + result = arith(start); popstackmark(&sm); len = cvtnum(result); if (likely(!(flag & EXP_QUOTED))) recordregion(begoff, begoff + len, 0); + +out: + return p; } @@ -512,6 +488,9 @@ expbackq(union node *cmd, int flag) int startloc; struct stackmark smark; + if (flag & EXP_DISCARD) + goto out; + INTOFF; startloc = expdest - (...