search for: subevalvar

Displaying 13 results from an estimated 13 matches for "subevalvar".

2019 Jan 25
0
[klibc:update-dash] [EXPAND] Propagate EXP_QPAT in subevalvar
...;a=commit;h=6fdcdeda572daa647e508fa3bbf972a8c5f73e02 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Fri, 23 Aug 2013 20:04:12 +1000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] [EXPAND] Propagate EXP_QPAT in subevalvar On Tue, Aug 28, 2012 at 01:27:24PM +0000, Todor Vlaev wrote: > > While playing around with parameter expansion I noticed that the > following didn't work in dash (dash 0.5.5.1-7.4ubuntu1) as compared > to bash even though I believe it should be POSIX-compliant: > > my_str=sw...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Propagate EXP_QPAT in subevalvar
...mit;h=a4e6b2aab296a5adc38372b157a854eb82054020 Author: Herbert Xu <herbert at gondor.apana.org.au> AuthorDate: Fri, 23 Aug 2013 20:04:12 +1000 Committer: Ben Hutchings <ben at decadent.org.uk> CommitDate: Sat, 28 Mar 2020 21:42:54 +0000 [klibc] dash: [EXPAND] Propagate EXP_QPAT in subevalvar [ dash commit a7c21a6f4cb42d967854cae954efd4ee66bdea9c ] On Tue, Aug 28, 2012 at 01:27:24PM +0000, Todor Vlaev wrote: > > While playing around with parameter expansion I noticed that the > following didn't work in dash (dash 0.5.5.1-7.4ubuntu1) as compared > to bash even though I...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...looking for the start of the arithmetic expansion, while evalvar will skip unexpanded words manually. This is cumbersome and error-prone. This patch fixes this by making word expansions proceed in a linear fashion. This means changing argstr and the various expansion functions such as expari and subevalvar to return the next character to be expanded. This is inspired by similar code from FreeBSD. However, 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 produ...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...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; - /* - * Remove any recorded regions beyond - * start of variable - */ - removerecordregions(startloc); - goto again; - } - goto end; - } - if (easy) + if (varlen...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...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; - /* - * Remove any recorded regions beyond - * start of variable - */ - removerecordregions(startloc); - goto again; - } - goto end; - } - if (easy) + if (varlen...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix multiple issues with EXP_DISCARD in evalvar
...*/ 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); + (flag & ~QUOTES_ESC) | + (discard ^ EXP_DISCARD)); - if (flag & EXP_DISCARD) - return p; + if ((flag | ~discard) & EXP_DISCARD) + goto record; varflags &= ~VSNUL; + subtype = VSNORMA...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...<ben at decadent.org.uk> --- usr/dash/expand.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index c4d52606..add952b7 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -116,7 +116,7 @@ STATIC const char *subevalvar(char *, char *, int, int, int, int, int); STATIC char *evalvar(char *, int); STATIC size_t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); S...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...<ben at decadent.org.uk> --- usr/dash/expand.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index c4d52606..add952b7 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -116,7 +116,7 @@ STATIC const char *subevalvar(char *, char *, int, int, int, int, int); STATIC char *evalvar(char *, int); STATIC size_t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); S...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Merge syntax/quotes in memtodest with flags
...ES_ESC (EXP_FULL | EXP_CASE) -/* Do not skip NUL characters. */ -#define QUOTES_KEEPNUL EXP_TILDE /* * Structure specifying which parts of the string should be searched @@ -117,8 +115,8 @@ STATIC char *exptilde(char *, char *, int); STATIC void expbackq(union node *, int); STATIC const char *subevalvar(char *, char *, int, int, int, int, int); STATIC char *evalvar(char *, int); -STATIC size_t strtodest(const char *, const char *, int); -STATIC void memtodest(const char *, size_t, const char *, int); +static size_t strtodest(const char *p, int flags); +static void memtodest(const char *p, size_t...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...rg.uk> --- usr/dash/expand.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index b3fdc11f..974a31de 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -119,7 +119,7 @@ STATIC const char *subevalvar(char *, char *, int, int, int, int, int); STATIC char *evalvar(char *, int); STATIC size_t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int, int *); +STATIC ssize_t varvalue(char *, int, int, int...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...rg.uk> --- usr/dash/expand.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index b3fdc11f..974a31de 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -119,7 +119,7 @@ STATIC const char *subevalvar(char *, char *, int, int, int, int, int); STATIC char *evalvar(char *, int); STATIC size_t strtodest(const char *, const char *, int); STATIC void memtodest(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int, int *); +STATIC ssize_t varvalue(char *, int, int, int...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...ote - * 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); argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ? - (flag & (EXP_QUOTED | EXP_QPAT) ? - EXP_QPAT : EXP_CASE) : 0))...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...ote - * 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); argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ? - (flag & (EXP_QUOTED | EXP_QPAT) ? - EXP_QPAT : EXP_CASE) : 0))...