aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/lex.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-10-21 11:43:13 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-10-21 11:43:13 -0700
commitfaaf40e55e002212c0c28f7845dfa2322eb7ad05 (patch)
tree9c61e6125d054439019c3c037e46353597018870 /sys/cmd/rc/lex.c
parent5c20d687c495f2cb3f3a390d04854dcceb2ef74e (diff)
feat(rc): string concatenation works
Diffstat (limited to 'sys/cmd/rc/lex.c')
-rw-r--r--sys/cmd/rc/lex.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cmd/rc/lex.c b/sys/cmd/rc/lex.c
index 31c7cdc..8ddf270 100644
--- a/sys/cmd/rc/lex.c
+++ b/sys/cmd/rc/lex.c
@@ -33,6 +33,9 @@ yyerror(const char *msg)
print(shell.err, "%s\n", msg);
flush(shell.err);
+ lexer.hadword = 0;
+ lexer.haddollar = 0;
+
/* consume remaining tokens */
while(lexer.c[0] !='\n' && lexer.c[0] != EOF)
advance();
@@ -193,6 +196,7 @@ yylex(void)
/* inject tokens */
if(lexer.hadword){
+ lexer.hadword = 0;
if(d=='('){
advance();
strcpy(lexer.buf, "( [Tindex]");