search for: begoff

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

2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...@@ removerecordregions(int endoff) * Expand arithmetic expression. Backup to start of expression, * evaluate, place result in (backed up) result, adjust string position. */ -void -expari(int flag) +static char *expari(char *start, int flag) { struct stackmark sm; - char *p, *start; int begoff; + int endoff; int len; intmax_t result; + char *p; - /* ifsfree(); */ - - /* - * This routine is slightly over-complicated for - * efficiency. Next we scan backwards looking for the - * start of arithmetic. - */ - start = stackblock(); - p = expdest; - pushstackmark(&sm, p - start);...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Ensure result is escaped in cvtnum
...int); STATIC char *scanright(char *, char *, char *, char *, int, int); @@ -463,7 +463,7 @@ static char *expari(char *start, int flag) result = arith(start); popstackmark(&sm); - len = cvtnum(result); + len = cvtnum(result, flag); if (likely(!(flag & EXP_QUOTED))) recordregion(begoff, begoff + len, 0); @@ -746,7 +746,7 @@ again: if (subtype == VSLENGTH) { if (flag & EXP_DISCARD) return p; - cvtnum(varlen > 0 ? varlen : 0); + cvtnum(varlen > 0 ? varlen : 0, flag); goto record; } @@ -795,15 +795,17 @@ record: * Put a string on the stack. */ -stat...
2019 Jan 25
0
[klibc:update-dash] expand: Fix bugs with words connected to the right of $@
...rt; } + inquotes ^= 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 = isdef...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix bugs with words connected to the right of $@
...rt; } + inquotes ^= 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 = isdef...