Displaying 13 results from an estimated 13 matches for "checkkwd".
Did you mean:
checked
2019 Jan 25
0
[klibc:update-dash] [PARSER] Simplify EOF/newline handling in list parser
...s(+), 34 deletions(-)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index f0c919d5..382ddf24 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -135,19 +135,13 @@ static inline int realeofmark(const char *eofmark)
union node *
parsecmd(int interact)
{
- int t;
-
tokpushback = 0;
+ checkkwd = 0;
+ heredoclist = 0;
doprompt = interact;
if (doprompt)
setprompt(doprompt);
needprompt = 0;
- t = readtoken();
- if (t == TEOF)
- return NEOF;
- if (t == TNL)
- return NULL;
- tokpushback++;
return list(1);
}
@@ -158,11 +152,27 @@ list(int nlflag)
union node *n1, *n2, *n3;
i...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Simplify EOF/newline handling in list parser
...s(+), 34 deletions(-)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index f0c919d5..382ddf24 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -135,19 +135,13 @@ static inline int realeofmark(const char *eofmark)
union node *
parsecmd(int interact)
{
- int t;
-
tokpushback = 0;
+ checkkwd = 0;
+ heredoclist = 0;
doprompt = interact;
if (doprompt)
setprompt(doprompt);
needprompt = 0;
- t = readtoken();
- if (t == TEOF)
- return NEOF;
- if (t == TNL)
- return NULL;
- tokpushback++;
return list(1);
}
@@ -158,11 +152,27 @@ list(int nlflag)
union node *n1, *n2, *n3;
i...
2019 Jan 25
0
[klibc:update-dash] parser: Fix backquote support in here-document EOF mark
...gt;
---
usr/dash/parser.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index cd980941..ae76400e 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -1037,6 +1037,11 @@ toggledq:
}
break;
case CBQUOTE: /* '`' */
+ if (checkkwd & CHKEOFMARK) {
+ USTPUTC('`', out);
+ break;
+ }
+
PARSEBACKQOLD();
break;
case CEOF:
2020 Mar 28
0
[klibc:update-dash] dash: parser: Fix backquote support in here-document EOF mark
...gt;
---
usr/dash/parser.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/usr/dash/parser.c b/usr/dash/parser.c
index cd980941..ae76400e 100644
--- a/usr/dash/parser.c
+++ b/usr/dash/parser.c
@@ -1037,6 +1037,11 @@ toggledq:
}
break;
case CBQUOTE: /* '`' */
+ if (checkkwd & CHKEOFMARK) {
+ USTPUTC('`', out);
+ break;
+ }
+
PARSEBACKQOLD();
break;
case CEOF:
2020 Mar 28
0
[klibc:update-dash] dash: parser: Do not push token back before parseheredoc
...switch (peektoken()) {
+ switch (readtoken()) {
case TNL:
if (!(nlflag & 1))
break;
@@ -177,9 +177,12 @@ list(int nlflag)
if (!n1 && (nlflag & 1))
n1 = NEOF;
parseheredoc();
+ tokpushback++;
+ lasttoken = TEOF;
return n1;
}
+ tokpushback++;
checkkwd = CHKNL | CHKKWD | CHKALIAS;
if (nlflag == 2 && tokendlist[peektoken()])
return n1;
2011 Jun 14
0
klibc 1.5.23 release
...L removal
[klibc] [ERROR] Allow the originator of EXERROR to set the exit status
[klibc] [EXPAND] Free IFS state in evalbackcmd
[klibc] [BUILTIN] Fix CTLESC clobbering by read(1)
[klibc] [BUILTIN] Fix backslash handling in read(1)
[klibc] [PARSER] Fix clobbering of checkkwd
Jilles Tjoelker (5):
[klibc] [EVAL] Force fork if any trap is set, not just on EXIT
[klibc] [EXPAND] Fix corruption of redirections with byte 0x81
[klibc] [VAR] Fix varinit ordering that broke fc
[klibc] [REDIR] Replace GPL noclobberopen code with the FreeBSD version...
2019 Jan 25
0
[klibc:update-dash] [PARSER] Handle backslash newlines properly after dollar sign
...\') {
+ if (pgetc() != '\n') {
+ pungetc();
+ break;
+ }
+
+ plinno++;
+ if (doprompt)
+ setprompt(2);
+ }
+
+ return c;
+}
+
/*
@@ -1179,7 +1197,7 @@ parsesub: {
char *p;
static const char types[] = "}-+?=";
- c = pgetc();
+ c = pgetc_eatbnl();
if (
(checkkwd & CHKEOFMARK) ||
c <= PEOA ||
@@ -1188,7 +1206,7 @@ parsesub: {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
- if (pgetc() == '(') {
+ if (pgetc_eatbnl() == '(') {
PARSEARITH();
} else {
pungetc()...
2020 Mar 28
0
[klibc:update-dash] dash: [PARSER] Handle backslash newlines properly after dollar sign
...\') {
+ if (pgetc() != '\n') {
+ pungetc();
+ break;
+ }
+
+ plinno++;
+ if (doprompt)
+ setprompt(2);
+ }
+
+ return c;
+}
+
/*
@@ -1179,7 +1197,7 @@ parsesub: {
char *p;
static const char types[] = "}-+?=";
- c = pgetc();
+ c = pgetc_eatbnl();
if (
(checkkwd & CHKEOFMARK) ||
c <= PEOA ||
@@ -1188,7 +1206,7 @@ parsesub: {
USTPUTC('$', out);
pungetc();
} else if (c == '(') { /* $(command) or $((arith)) */
- if (pgetc() == '(') {
+ if (pgetc_eatbnl() == '(') {
PARSEARITH();
} else {
pungetc()...
2019 Jan 25
0
[klibc:update-dash] input: Move all input state into parsefile
...t;nextc = s;
+ parsefile->nleft = len;
INTON;
}
@@ -365,7 +339,8 @@ popstring(void)
INTOFF;
if (sp->ap) {
- if (parsenextc[-1] == ' ' || parsenextc[-1] == '\t') {
+ if (parsefile->nextc[-1] == ' ' ||
+ parsefile->nextc[-1] == '\t') {
checkkwd |= CHKALIAS;
}
if (sp->string != sp->ap->val) {
@@ -376,8 +351,8 @@ popstring(void)
unalias(sp->ap->name);
}
}
- parsenextc = sp->prevstring;
- parsenleft = sp->prevnleft;
+ parsefile->nextc = sp->prevstring;
+ parsefile->nleft = sp->prevnleft;
/*dpr...
2020 Mar 28
0
[klibc:update-dash] dash: input: Move all input state into parsefile
...t;nextc = s;
+ parsefile->nleft = len;
INTON;
}
@@ -365,7 +339,8 @@ popstring(void)
INTOFF;
if (sp->ap) {
- if (parsenextc[-1] == ' ' || parsenextc[-1] == '\t') {
+ if (parsefile->nextc[-1] == ' ' ||
+ parsefile->nextc[-1] == '\t') {
checkkwd |= CHKALIAS;
}
if (sp->string != sp->ap->val) {
@@ -376,8 +351,8 @@ popstring(void)
unalias(sp->ap->name);
}
}
- parsenextc = sp->prevstring;
- parsenleft = sp->prevnleft;
+ parsefile->nextc = sp->prevstring;
+ parsefile->nleft = sp->prevnleft;
/*dpr...
2019 Jan 25
0
[klibc:update-dash] [SHELL] Optimize dash -c "command" to avoid a fork
..., prompt the user */
int needprompt; /* true if interactive and at start of line */
int lasttoken; /* last token read */
-MKINIT int tokpushback; /* last token pushed back */
+int tokpushback; /* last token pushed back */
char *wordtext; /* text of last word returned by readtoken */
int checkkwd;
struct nodelist *backquotelist;
@@ -210,6 +210,7 @@ list(int nlflag)
parseheredoc();
else
pungetc(); /* push back EOF on input */
+ tokpushback++;
return n1;
default:
if (nlflag == 1)
diff --git a/usr/dash/parser.h b/usr/dash/parser.h
index e6caed63..2875cce6 100644
--...
2020 Mar 28
0
[klibc:update-dash] dash: [SHELL] Optimize dash -c "command" to avoid a fork
..., prompt the user */
int needprompt; /* true if interactive and at start of line */
int lasttoken; /* last token read */
-MKINIT int tokpushback; /* last token pushed back */
+int tokpushback; /* last token pushed back */
char *wordtext; /* text of last word returned by readtoken */
int checkkwd;
struct nodelist *backquotelist;
@@ -210,6 +210,7 @@ list(int nlflag)
parseheredoc();
else
pungetc(); /* push back EOF on input */
+ tokpushback++;
return n1;
default:
if (nlflag == 1)
diff --git a/usr/dash/parser.h b/usr/dash/parser.h
index e6caed63..2875cce6 100644
--...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
...ar *p)
+int isassignment(const char *p)
{
const char *q = endofname(p);
if (p == q)
diff --git a/usr/dash/parser.h b/usr/dash/parser.h
index 2875cce6..524ac1c7 100644
--- a/usr/dash/parser.h
+++ b/usr/dash/parser.h
@@ -82,6 +82,7 @@ extern int whichprompt; /* 1 == PS1, 2 == PS2 */
extern int checkkwd;
+int isassignment(const char *p);
union node *parsecmd(int);
void fixredir(union node *, const char *, int);
const char *getprompt(void *);