Displaying 13 results from an estimated 13 matches for "vsnormal".
Did you mean:
isnormal
2019 Jan 25
0
[klibc:update-dash] parser: Fix parameter expansion inside inner double quotes
...r.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index efa8060f..8e407816 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -1325,10 +1325,11 @@ badsub:
pungetc();
}
- if (newsyn == ARISYNTAX && subtype > VSNORMAL)
+ if (newsyn == ARISYNTAX)
newsyn = DQSYNTAX;
- if (newsyn != synstack->syntax) {
+ if ((newsyn != synstack->syntax || synstack->innerdq) &&
+ subtype != VSNORMAL) {
synstack_push(&synstack,
synstack->prev ?:
alloca(sizeof(*synstack))...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix parameter expansion inside inner double quotes
...r.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index efa8060f..8e407816 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -1325,10 +1325,11 @@ badsub:
pungetc();
}
- if (newsyn == ARISYNTAX && subtype > VSNORMAL)
+ if (newsyn == ARISYNTAX)
newsyn = DQSYNTAX;
- if (newsyn != synstack->syntax) {
+ if ((newsyn != synstack->syntax || synstack->innerdq) &&
+ subtype != VSNORMAL) {
synstack_push(&synstack,
synstack->prev ?:
alloca(sizeof(*synstack))...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix multiple issues with EXP_DISCARD in evalvar
...evalvar(p, var, 0, startloc, varflags,
- flag & ~QUOTES_ESC);
+ (flag & ~QUOTES_ESC) |
+ (discard ^ EXP_DISCARD));
- if (flag & EXP_DISCARD)
- return p;
+ if ((flag | ~discard) & 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;
}...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...nd
- * start of variable
- */
- removerecordregions(startloc);
goto again;
}
@@ -759,20 +744,14 @@ vsplus:
varunset(p, var, 0, 0);
if (subtype == VSLENGTH) {
+ if (flag & EXP_DISCARD)
+ return p;
cvtnum(varlen > 0 ? varlen : 0);
goto record;
}
- if (subtype == VSNORMAL) {
-record:
- if (quoted) {
- quoted = *var == '@' && shellparam.nparam;
- if (!quoted)
- goto end;
- }
- recordregion(startloc, expdest - (char *)stackblock(), quoted);
- goto end;
- }
+ if (subtype == VSNORMAL)
+ goto record;
#ifdef DEBUG
switch (subtype) {
@@ -78...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...+ subtype = c == '#' ? VSTRIMLEFT :
+ VSTRIMRIGHT;
+ c = pgetc_eatbnl();
+ if (c == cc)
+ subtype++;
+ else
+ pungetc();
+
+ newsyn = BASESYNTAX;
+ break;
}
} else {
badsub:
pungetc();
}
+
+ if (newsyn == ARISYNTAX && subtype > VSNORMAL)
+ newsyn = DQSYNTAX;
+
+ if (newsyn != synstack->syntax) {
+ synstack_push(&synstack,
+ synstack->prev ?:
+ alloca(sizeof(*synstack)),
+ newsyn);
+
+ synstack->varpushed++;
+ synstack->dblquote = newsyn != BASESYNTAX;
+ }
+
*((char *)stackblo...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...+ subtype = c == '#' ? VSTRIMLEFT :
+ VSTRIMRIGHT;
+ c = pgetc_eatbnl();
+ if (c == cc)
+ subtype++;
+ else
+ pungetc();
+
+ newsyn = BASESYNTAX;
+ break;
}
} else {
badsub:
pungetc();
}
+
+ if (newsyn == ARISYNTAX && subtype > VSNORMAL)
+ newsyn = DQSYNTAX;
+
+ if (newsyn != synstack->syntax) {
+ synstack_push(&synstack,
+ synstack->prev ?:
+ alloca(sizeof(*synstack)),
+ newsyn);
+
+ synstack->varpushed++;
+ synstack->dblquote = newsyn != BASESYNTAX;
+ }
+
*((char *)stackblo...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...tartloc, varflags,
+ flag & ~QUOTES_ESC);
+ varflags &= ~VSNUL;
+ /*
+ * Remove any recorded regions 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
...tartloc, varflags,
+ flag & ~QUOTES_ESC);
+ varflags &= ~VSNUL;
+ /*
+ * Remove any recorded regions 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: Fix skipping of command substitution when trimming in evalvar
...ent.org.uk>
---
usr/dash/expand.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index a764881e..df226632 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -805,6 +805,8 @@ record:
goto record;
}
+ varlen = 0;
+
end:
if (subtype != VSNORMAL) { /* skip to end of alternative */
int nesting = 1;
2019 Jan 25
0
[klibc:update-dash] [PARSER] Handle backslash newlines properly after dollar sign
...: {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
- if (pgetc() == '(') {
+ if (pgetc_eatbnl() == '(') {
PARSEARITH();
} else {
pungetc();
@@ -1200,25 +1218,25 @@ parsesub: {
STADJUST(1, out);
subtype = VSNORMAL;
if (likely(c == '{')) {
- c = pgetc();
+ c = pgetc_eatbnl();
subtype = 0;
}
varname:
if (is_name(c)) {
do {
STPUTC(c, out);
- c = pgetc();
+ c = pgetc_eatbnl();
} while (is_in_name(c));
} else if (is_digit(c)) {
do {
STPUTC(c, out);
- c =...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Handle backslash newlines properly after dollar sign
...: {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
- if (pgetc() == '(') {
+ if (pgetc_eatbnl() == '(') {
PARSEARITH();
} else {
pungetc();
@@ -1200,25 +1218,25 @@ parsesub: {
STADJUST(1, out);
subtype = VSNORMAL;
if (likely(c == '{')) {
- c = pgetc();
+ c = pgetc_eatbnl();
subtype = 0;
}
varname:
if (is_name(c)) {
do {
STPUTC(c, out);
- c = pgetc();
+ c = pgetc_eatbnl();
} while (is_in_name(c));
} else if (is_digit(c)) {
do {
STPUTC(c, out);
- c =...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...aram.nparam));
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag, "ed);
+ varlen = varvalue(var, varflags, flag, quoted);
if (varflags & VSNUL)
varlen--;
@@ -771,8 +769,11 @@ vsplus:
if (subtype == VSNORMAL) {
record:
- if (!easy)
- goto end;
+ if (quoted) {
+ quoted = *var == '@' && shellparam.nparam;
+ if (!quoted)
+ goto end;
+ }
recordregion(startloc, expdest - (char *)stackblock(), quoted);
goto end;
}
@@ -878,7 +879,7 @@ strtodest(p, syntax, quotes)
*/
S...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...aram.nparam));
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag, "ed);
+ varlen = varvalue(var, varflags, flag, quoted);
if (varflags & VSNUL)
varlen--;
@@ -771,8 +769,11 @@ vsplus:
if (subtype == VSNORMAL) {
record:
- if (!easy)
- goto end;
+ if (quoted) {
+ quoted = *var == '@' && shellparam.nparam;
+ if (!quoted)
+ goto end;
+ }
recordregion(startloc, expdest - (char *)stackblock(), quoted);
goto end;
}
@@ -878,7 +879,7 @@ strtodest(p, syntax, quotes)
*/
S...