Displaying 9 results from an estimated 9 matches for "breakloop".
2019 Jan 25
0
[klibc:update-dash] parser: use pgetc_eatbnl() in more places
...e ' ': case '\t':
case PEOA:
@@ -791,30 +794,23 @@ xxreadtoken(void)
while ((c = pgetc()) != '\n' && c != PEOF);
pungetc();
continue;
- case '\\':
- if (pgetc() == '\n') {
- nlprompt();
- continue;
- }
- pungetc();
- goto breakloop;
case '\n':
nlnoprompt();
RETURN(TNL);
case PEOF:
RETURN(TEOF);
case '&':
- if (pgetc() == '&')
+ if (pgetc_eatbnl() == '&')
RETURN(TAND);
pungetc();
RETURN(TBACKGND);
case '|':
- if (pgetc() == '|...
2020 Mar 28
0
[klibc:update-dash] dash: parser: use pgetc_eatbnl() in more places
...e ' ': case '\t':
case PEOA:
@@ -791,30 +794,23 @@ xxreadtoken(void)
while ((c = pgetc()) != '\n' && c != PEOF);
pungetc();
continue;
- case '\\':
- if (pgetc() == '\n') {
- nlprompt();
- continue;
- }
- pungetc();
- goto breakloop;
case '\n':
nlnoprompt();
RETURN(TNL);
case PEOF:
RETURN(TEOF);
case '&':
- if (pgetc() == '&')
+ if (pgetc_eatbnl() == '&')
RETURN(TAND);
pungetc();
RETURN(TBACKGND);
case '|':
- if (pgetc() == '|...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...oc = expdest - (char *)stackblock() - end;
if (breakall && !inquotes && newloc > startloc) {
recordregion(startloc, newloc, 0);
}
@@ -290,14 +294,11 @@ start:
p += length + 1;
length = 0;
+ if (end)
+ break;
+
switch (c) {
- case '\0':
- goto breakloop;
case '=':
- if (flag & EXP_VARTILDE2) {
- p--;
- continue;
- }
flag |= EXP_VARTILDE2;
reject++;
/* fall through */
@@ -310,11 +311,6 @@ start:
goto tilde;
}
continue;
- }
-
- switch (c) {
- case CTLENDVAR: /* ??? */
- goto breakloop;
case C...
2019 Jan 25
0
[klibc:update-dash] [PARSER] Add nlprompt/nlnoprompt helpers
...no++;
+ needprompt = doprompt;
+}
+
/*
* Read the next input token.
@@ -786,16 +799,13 @@ xxreadtoken(void)
continue;
case '\\':
if (pgetc() == '\n') {
- plinno++;
- if (doprompt)
- setprompt(2);
+ nlprompt();
continue;
}
pungetc();
goto breakloop;
case '\n':
- plinno++;
- needprompt = doprompt;
+ nlnoprompt();
RETURN(TNL);
case PEOF:
RETURN(TEOF);
@@ -837,9 +847,7 @@ static int pgetc_eatbnl(void)
break;
}
- plinno++;
- if (doprompt)
- setprompt(2);
+ nlprompt();
}
return c;
@@ -913,9 +921,7 @@...
2019 Jan 25
0
[klibc:update-dash] expand: Fix bugs with words connected to the right of $@
...g.uk>
---
usr/dash/expand.c | 13 ++++++++-----
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 -...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Add nlprompt/nlnoprompt helpers
...no++;
+ needprompt = doprompt;
+}
+
/*
* Read the next input token.
@@ -786,16 +799,13 @@ xxreadtoken(void)
continue;
case '\\':
if (pgetc() == '\n') {
- plinno++;
- if (doprompt)
- setprompt(2);
+ nlprompt();
continue;
}
pungetc();
goto breakloop;
case '\n':
- plinno++;
- needprompt = doprompt;
+ nlnoprompt();
RETURN(TNL);
case PEOF:
RETURN(TEOF);
@@ -837,9 +847,7 @@ static int pgetc_eatbnl(void)
break;
}
- plinno++;
- if (doprompt)
- setprompt(2);
+ nlprompt();
}
return c;
@@ -913,9 +921,7 @@...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix bugs with words connected to the right of $@
...g.uk>
---
usr/dash/expand.c | 13 ++++++++-----
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 -...
2019 Jan 25
0
[klibc:update-dash] [PARSER] Handle backslash newlines properly after dollar sign
...<ben at decadent.org.uk>
---
usr/dash/parser.c | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index c4eaae2b..2b07437e 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -827,6 +827,24 @@ breakloop:
#undef RETURN
}
+static int pgetc_eatbnl(void)
+{
+ int c;
+
+ while ((c = pgetc()) == '\\') {
+ if (pgetc() != '\n') {
+ pungetc();
+ break;
+ }
+
+ plinno++;
+ if (doprompt)
+ setprompt(2);
+ }
+
+ return c;
+}
+
/*
@@ -1179,7 +1197,7 @@ parsesub: {
char *p;...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Handle backslash newlines properly after dollar sign
...<ben at decadent.org.uk>
---
usr/dash/parser.c | 36 +++++++++++++++++++++++++++---------
1 file changed, 27 insertions(+), 9 deletions(-)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index c4eaae2b..2b07437e 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -827,6 +827,24 @@ breakloop:
#undef RETURN
}
+static int pgetc_eatbnl(void)
+{
+ int c;
+
+ while ((c = pgetc()) == '\\') {
+ if (pgetc() != '\n') {
+ pungetc();
+ break;
+ }
+
+ plinno++;
+ if (doprompt)
+ setprompt(2);
+ }
+
+ return c;
+}
+
/*
@@ -1179,7 +1197,7 @@ parsesub: {
char *p;...