search for: sqsyntax

Displaying 10 results from an estimated 10 matches for "sqsyntax".

Did you mean: dqsyntax
2019 Jan 25
0
[klibc:update-dash] parser: Fix incorrect eating of backslash newlines
...ns(+), 3 deletions(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 8e407816..8bd3db44 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -853,6 +853,11 @@ static int pgetc_eatbnl(void) return c; } +static int pgetc_top(struct synstack *stack) +{ + return stack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl(); +} + static void synstack_push(struct synstack **stack, struct synstack *next, const char *syntax) { @@ -915,7 +920,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) attyline(); if (synstack->syntax == BASESYNTAX) retur...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix incorrect eating of backslash newlines
...ns(+), 3 deletions(-) diff --git a/usr/dash/parser.c b/usr/dash/parser.c index 8e407816..8bd3db44 100644 --- a/usr/dash/parser.c +++ b/usr/dash/parser.c @@ -853,6 +853,11 @@ static int pgetc_eatbnl(void) return c; } +static int pgetc_top(struct synstack *stack) +{ + return stack->syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl(); +} + static void synstack_push(struct synstack **stack, struct synstack *next, const char *syntax) { @@ -915,7 +920,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) attyline(); if (synstack->syntax == BASESYNTAX) retur...
2019 Jan 25
0
[klibc:update-dash] parser: use pgetc_eatbnl() in more places
...(int, char const *, char *, int); STATIC void synexpect(int) __attribute__((__noreturn__)); STATIC void synerror(const char *) __attribute__((__noreturn__)); @@ -656,8 +657,10 @@ parseheredoc(void) if (needprompt) { setprompt(2); } - readtoken1(pgetc(), here->here->type == NHERE? SQSYNTAX : DQSYNTAX, - here->eofmark, here->striptabs); + if (here->here->type == NHERE) + readtoken1(pgetc(), SQSYNTAX, here->eofmark, here->striptabs); + else + readtoken1(pgetc_eatbnl(), DQSYNTAX, here->eofmark, here->striptabs); n = (union node *)stalloc(sizeof (struc...
2020 Mar 28
0
[klibc:update-dash] dash: parser: use pgetc_eatbnl() in more places
...(int, char const *, char *, int); STATIC void synexpect(int) __attribute__((__noreturn__)); STATIC void synerror(const char *) __attribute__((__noreturn__)); @@ -656,8 +657,10 @@ parseheredoc(void) if (needprompt) { setprompt(2); } - readtoken1(pgetc(), here->here->type == NHERE? SQSYNTAX : DQSYNTAX, - here->eofmark, here->striptabs); + if (here->here->type == NHERE) + readtoken1(pgetc(), SQSYNTAX, here->eofmark, here->striptabs); + else + readtoken1(pgetc_eatbnl(), DQSYNTAX, here->eofmark, here->striptabs); n = (union node *)stalloc(sizeof (struc...
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...onst *syntax, char *eofmark, int striptabs) if (c == '\034' && doprompt && attyset() && ! equal(termval(), "emacs")) { attyline(); - if (syntax == BASESYNTAX) + if (synstack->syntax == BASESYNTAX) return readtoken(); c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl(); goto loop; @@ -904,9 +922,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) CHECKEND(); /* set c to PEOF if at end of here document */ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...onst *syntax, char *eofmark, int striptabs) if (c == '\034' && doprompt && attyset() && ! equal(termval(), "emacs")) { attyline(); - if (syntax == BASESYNTAX) + if (synstack->syntax == BASESYNTAX) return readtoken(); c = syntax == SQSYNTAX ? pgetc() : pgetc_eatbnl(); goto loop; @@ -904,9 +922,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) CHECKEND(); /* set c to PEOF if at end of here document */ for (;;) { /* until end of line or end of word */ CHECKSTRSPACE(4, out); /* permit 4 calls to...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Merge syntax/quotes in memtodest with flags
...x and quotes are both derived from the expansion flags. As syntax is only used by memtodest we do not need to maintain it outside of the function at all. The only place that uses something other than BASESYNTAX or DQSYNTAX is exptilde. However in that case DQSYNTAX has exactly the same effect as SQSYNTAX. This patch merges these two arguments into a single flags. The macro QUOTES_KEEPNUL has been renamed to EXP_KEEPNUL in order to keep the namespace separate. Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/das...
2019 Jan 25
0
[klibc:update-dash] parser: Fix single-quoted patterns in here-documents
...ter: Ben Hutchings <ben at decadent.org.uk> CommitDate: Fri, 25 Jan 2019 02:57:21 +0000 [klibc] parser: Fix single-quoted patterns in here-documents The script x=* cat <<- EOF ${x#'*'} EOF prints * instead of nothing as it should. The problem is that when we're in sqsyntax context in a here-document, we won't add CTLESC as we should. This patch fixes it: Reported-by: Harald van Dijk <harald at gigawatt.nl> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/parser.c |...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix single-quoted patterns in here-documents
...at, 28 Mar 2020 21:42:54 +0000 [klibc] dash: parser: Fix single-quoted patterns in here-documents [ dash commit 9ee3343965950bad08e97f43c8c376b89a50b099 ] The script x=* cat <<- EOF ${x#'*'} EOF prints * instead of nothing as it should. The problem is that when we're in sqsyntax context in a here-document, we won't add CTLESC as we should. This patch fixes it: Reported-by: Harald van Dijk <harald at gigawatt.nl> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/parser.c |...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Use HOME in tilde expansion when it is empty
...ion(+), 1 deletion(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 6ea0562f..f1f5a9fa 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -385,7 +385,7 @@ done: } else { home = getpwhome(name); } - if (!home || !*home) + if (!home) goto lose; *p = c; strtodest(home, SQSYNTAX, quotes);