Displaying 15 results from an estimated 15 matches for "exp_quot".
Did you mean:
exe"
2020 Mar 28
0
[klibc:update-dash] dash: expand: Merge syntax/quotes in memtodest with flags
...LOB
@@ -359,7 +357,6 @@ exptilde(char *startp, char *p, int flag)
signed char c;
char *name;
const char *home;
- int quotes = flag & QUOTES_ESC;
name = p + 1;
@@ -388,7 +385,7 @@ done:
if (!home)
goto lose;
*p = c;
- strtodest(home, SQSYNTAX, quotes);
+ strtodest(home, flag | EXP_QUOTED);
return (p);
lose:
*p = c;
@@ -513,7 +510,6 @@ expbackq(union node *cmd, int flag)
char *p;
char *dest;
int startloc;
- char const *syntax = flag & EXP_QUOTED ? DQSYNTAX : BASESYNTAX;
struct stackmark smark;
INTOFF;
@@ -527,7 +523,7 @@ expbackq(union node *cmd, int flag)
i...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...xpandmeta(struct strlist *, int);
#ifdef HAVE_GLOB
STATIC void addglob(const glob_t *);
@@ -712,7 +712,6 @@ evalvar(char *p, int flag)
int c;
int startloc;
ssize_t varlen;
- int easy;
int quoted;
varflags = *p++;
@@ -723,12 +722,11 @@ evalvar(char *p, int flag)
quoted = flag & EXP_QUOTED;
var = p;
- easy = (!quoted || (*var == '@' && shellparam.nparam));
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag, "ed);
+ varlen = varvalue(var, varflags, flag, quoted);
if (varflags &a...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...xpandmeta(struct strlist *, int);
#ifdef HAVE_GLOB
STATIC void addglob(const glob_t *);
@@ -712,7 +712,6 @@ evalvar(char *p, int flag)
int c;
int startloc;
ssize_t varlen;
- int easy;
int quoted;
varflags = *p++;
@@ -723,12 +722,11 @@ evalvar(char *p, int flag)
quoted = flag & EXP_QUOTED;
var = p;
- easy = (!quoted || (*var == '@' && shellparam.nparam));
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag, "ed);
+ varlen = varvalue(var, varflags, flag, quoted);
if (varflags &a...
2019 Jan 25
0
[klibc:update-dash] expand: Fix bugs with words connected to the right of $@
...--
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index 2c29ea44..b3fdc11f 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -318,13 +318,13 @@ start:
case CTLENDVAR: /* ??? */
goto breakloop;
case CTLQUOTEMARK:
- inquotes ^= EXP_QUOTED;
/* "$@" syntax adherence hack */
- if (inquotes && !memcmp(p, dolatstr + 1,
- DOLATSTRLEN - 1)) {
- p = evalvar(p + 1, flag | inquotes) + 1;
+ if (!inquotes && !memcmp(p, dolatstr + 1,
+ DOLATSTRLEN - 1)) {
+ p = evalvar(p + 1, flag | EXP_QUOTED...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix bugs with words connected to the right of $@
...--
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index 2c29ea44..b3fdc11f 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -318,13 +318,13 @@ start:
case CTLENDVAR: /* ??? */
goto breakloop;
case CTLQUOTEMARK:
- inquotes ^= EXP_QUOTED;
/* "$@" syntax adherence hack */
- if (inquotes && !memcmp(p, dolatstr + 1,
- DOLATSTRLEN - 1)) {
- p = evalvar(p + 1, flag | inquotes) + 1;
+ if (!inquotes && !memcmp(p, dolatstr + 1,
+ DOLATSTRLEN - 1)) {
+ p = evalvar(p + 1, flag | EXP_QUOTED...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Propagate EXP_QPAT in subevalvar
.../expand.c
+++ b/usr/dash/expand.c
@@ -650,7 +650,8 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
char *(*scan)(char *, char *, char *, char *, int , int);
argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ?
- (flag & EXP_QUOTED ? EXP_QPAT : EXP_CASE) : 0));
+ (flag & (EXP_QUOTED | EXP_QPAT) ?
+ EXP_QPAT : EXP_CASE) : 0));
STPUTC('\0', expdest);
argbackq = saveargbackq;
startp = stackblock() + startloc;
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Propagate EXP_QPAT in subevalvar
.../expand.c
+++ b/usr/dash/expand.c
@@ -650,7 +650,8 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
char *(*scan)(char *, char *, char *, char *, int , int);
argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ?
- (flag & EXP_QUOTED ? EXP_QPAT : EXP_CASE) : 0));
+ (flag & (EXP_QUOTED | EXP_QPAT) ?
+ EXP_QPAT : EXP_CASE) : 0));
STPUTC('\0', expdest);
argbackq = saveargbackq;
startp = stackblock() + startloc;
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Optimise nulonly away and just use quoted as before
...a..a2f99f14 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -722,7 +722,6 @@ evalvar(char *p, int flag)
ssize_t varlen;
int easy;
int quoted;
- int nulonly;
varflags = *p++;
subtype = varflags & VSTYPE;
@@ -733,12 +732,11 @@ evalvar(char *p, int flag)
quoted = flag & EXP_QUOTED;
var = p;
easy = (!quoted || (*var == '@' && shellparam.nparam));
- nulonly = easy;
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag, &nulonly);
+ varlen = varvalue(var, varflags, flag, &qu...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Optimise nulonly away and just use quoted as before
...a..a2f99f14 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -722,7 +722,6 @@ evalvar(char *p, int flag)
ssize_t varlen;
int easy;
int quoted;
- int nulonly;
varflags = *p++;
subtype = varflags & VSTYPE;
@@ -733,12 +732,11 @@ evalvar(char *p, int flag)
quoted = flag & EXP_QUOTED;
var = p;
easy = (!quoted || (*var == '@' && shellparam.nparam));
- nulonly = easy;
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag, &nulonly);
+ varlen = varvalue(var, varflags, flag, &qu...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...@@ exptilde(char *startp, char *p, int flag)
}
}
done:
+ if (flag & EXP_DISCARD)
+ goto out;
*p = '\0';
if (*name == '\0') {
home = lookupvar(homestr);
} else {
home = getpwhome(name);
}
+ *p = c;
if (!home)
goto lose;
- *p = c;
strtodest(home, flag | EXP_QUOTED);
+out:
return (p);
lose:
- *p = c;
return (startp);
}
@@ -437,63 +433,43 @@ 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 cha...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Ensure result is escaped in cvtnum
...char *, char *, char *, int, 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 strin...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...fine QUOTES_KEEPNUL EXP_TILDE
@@ -335,16 +335,6 @@ addquote:
case CTLESC:
startloc++;
length++;
-
- /*
- * Quoted parameter expansion pattern: remove quote
- * unless inside inner quotes or we have a literal
- * backslash.
- */
- if (((flag | inquotes) & (EXP_QPAT | EXP_QUOTED)) ==
- EXP_QPAT && *p != '\\')
- break;
-
goto addquote;
case CTLVAR:
p = evalvar(p, flag | inquotes);
@@ -653,8 +643,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
char *(*scan)(char *, char *, char *, char *, int , int...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...fine QUOTES_KEEPNUL EXP_TILDE
@@ -335,16 +335,6 @@ addquote:
case CTLESC:
startloc++;
length++;
-
- /*
- * Quoted parameter expansion pattern: remove quote
- * unless inside inner quotes or we have a literal
- * backslash.
- */
- if (((flag | inquotes) & (EXP_QPAT | EXP_QUOTED)) ==
- EXP_QPAT && *p != '\\')
- break;
-
goto addquote;
case CTLVAR:
p = evalvar(p, flag | inquotes);
@@ -653,8 +643,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
char *(*scan)(char *, char *, char *, char *, int , int...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...t *, int);
#ifdef HAVE_GLOB
STATIC void addglob(const glob_t *);
@@ -722,6 +722,7 @@ evalvar(char *p, int flag)
ssize_t varlen;
int easy;
int quoted;
+ int nulonly;
varflags = *p++;
subtype = varflags & VSTYPE;
@@ -732,11 +733,12 @@ evalvar(char *p, int flag)
quoted = flag & EXP_QUOTED;
var = p;
easy = (!quoted || (*var == '@' && shellparam.nparam));
+ nulonly = easy;
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag);
+ varlen = varvalue(var, varflags, flag, &nulonly);
if (...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...t *, int);
#ifdef HAVE_GLOB
STATIC void addglob(const glob_t *);
@@ -722,6 +722,7 @@ evalvar(char *p, int flag)
ssize_t varlen;
int easy;
int quoted;
+ int nulonly;
varflags = *p++;
subtype = varflags & VSTYPE;
@@ -732,11 +733,12 @@ evalvar(char *p, int flag)
quoted = flag & EXP_QUOTED;
var = p;
easy = (!quoted || (*var == '@' && shellparam.nparam));
+ nulonly = easy;
startloc = expdest - (char *)stackblock();
p = strchr(p, '=') + 1;
again:
- varlen = varvalue(var, varflags, flag);
+ varlen = varvalue(var, varflags, flag, &nulonly);
if (...