Displaying 8 results from an estimated 8 matches for "exp_word".
Did you mean:
elf_word
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...we take
things one step further and completely remove the manual word
skipping in evalvar. This is accomplished by introducing a new
EXP_DISCARD flag that tells argstr to only parse and not produce
any actual expansions.
Incidentally, argstr will now always NUL-terminate the expansion
unless the EXP_WORD flag is set. This is because all but one
caller of argstr wants the result to be NUL-termianted.
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 | 294 ++++++++++++++++++++++++---------------------...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix multiple issues with EXP_DISCARD in evalvar
...*p++;
@@ -713,41 +714,41 @@ again:
if (varflags & VSNUL)
varlen--;
+ discard = varlen < 0 ? EXP_DISCARD : 0;
+
switch (subtype) {
case VSPLUS:
- varlen = -1 - varlen;
+ discard ^= EXP_DISCARD;
/* fall through */
case 0:
case VSMINUS:
- p = argstr(p, flag | EXP_TILDE | EXP_WORD);
- if (varlen < 0)
- return p;
+ p = argstr(p, flag | EXP_TILDE | EXP_WORD |
+ (discard ^ EXP_DISCARD));
goto record;
case VSASSIGN:
case VSQUESTION:
- if (varlen >= 0)
- goto record;
-
p = subevalvar(p, var, 0, startloc, varflags,
- flag & ~QUOTES_ESC...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...r/dash/expand.c | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index add952b7..9bbd19da 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -753,28 +753,22 @@ vsplus:
argstr(p, flag | EXP_TILDE | EXP_WORD);
goto end;
}
- if (easy)
- goto record;
- goto end;
+ goto record;
}
if (subtype == VSASSIGN || subtype == VSQUESTION) {
- if (varlen < 0) {
- if (subevalvar(p, var, 0, subtype, startloc,
- varflags, flag & ~QUOTES_ESC)) {
- varflags &= ~VSNUL;
- /*...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...r/dash/expand.c | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index add952b7..9bbd19da 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -753,28 +753,22 @@ vsplus:
argstr(p, flag | EXP_TILDE | EXP_WORD);
goto end;
}
- if (easy)
- goto record;
- goto end;
+ goto record;
}
if (subtype == VSASSIGN || subtype == VSQUESTION) {
- if (varlen < 0) {
- if (subevalvar(p, var, 0, subtype, startloc,
- varflags, flag & ~QUOTES_ESC)) {
- varflags &= ~VSNUL;
- /*...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix double-decrement in argstr
...1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index 20362cef..562a4869 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -285,7 +285,7 @@ start:
q = stnputs(p, length, expdest);
q[-1] &= end - 1;
expdest = q - (flag & EXP_WORD ? end : 0);
- newloc = expdest - (char *)stackblock() - end;
+ newloc = q - (char *)stackblock() - end;
if (breakall && !inquotes && newloc > startloc) {
recordregion(startloc, newloc, 0);
}
2020 Mar 28
0
[klibc:update-dash] dash: expand: Merge syntax/quotes in memtodest with flags
...ax, quotes);
+ len = strtodest(p, flags);
break;
}
diff --git a/usr/dash/expand.h b/usr/dash/expand.h
index 5c767e66..375914d3 100644
--- a/usr/dash/expand.h
+++ b/usr/dash/expand.h
@@ -61,6 +61,7 @@ struct arglist {
#define EXP_VARTILDE2 0x40 /* expand tildes after colons only */
#define EXP_WORD 0x80 /* expand word in parameter expansion */
#define EXP_QUOTED 0x100 /* expand word in double quotes */
+#define EXP_KEEPNUL 0x200 /* do not skip NUL characters */
union node;
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...in an assignment */
#define EXP_REDIR 0x8 /* file glob for a redirection (1 match only) */
#define EXP_CASE 0x10 /* keeps quotes around for CASE pattern */
-#define EXP_QPAT 0x20 /* pattern in quoted parameter expansion */
#define EXP_VARTILDE2 0x40 /* expand tildes after colons only */
#define EXP_WORD 0x80 /* expand word in parameter expansion */
#define EXP_QUOTED 0x100 /* expand word in double quotes */
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index 8b945e36..c28363ca 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -80,6 +80,18 @@ struct heredoc {
int striptabs; /* if s...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...in an assignment */
#define EXP_REDIR 0x8 /* file glob for a redirection (1 match only) */
#define EXP_CASE 0x10 /* keeps quotes around for CASE pattern */
-#define EXP_QPAT 0x20 /* pattern in quoted parameter expansion */
#define EXP_VARTILDE2 0x40 /* expand tildes after colons only */
#define EXP_WORD 0x80 /* expand word in parameter expansion */
#define EXP_QUOTED 0x100 /* expand word in double quotes */
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index 8b945e36..c28363ca 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -80,6 +80,18 @@ struct heredoc {
int striptabs; /* if s...