aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-03-18 18:54:54 +0000
committerrsc <devnull@localhost>2005-03-18 18:54:54 +0000
commit168518a993a67436d00c40f4f9cea68a296a2034 (patch)
treedf2fedb69fcc4100bc3724577893d22fb98ce7ad /src/cmd/rc
parent6a8f21b2cc4d8d3b1eabfd504b6a0a050149523e (diff)
downloadplan9port-168518a993a67436d00c40f4f9cea68a296a2034.tar.gz
plan9port-168518a993a67436d00c40f4f9cea68a296a2034.tar.bz2
plan9port-168518a993a67436d00c40f4f9cea68a296a2034.zip
correct command-printing bug
Diffstat (limited to 'src/cmd/rc')
-rw-r--r--src/cmd/rc/lex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/rc/lex.c b/src/cmd/rc/lex.c
index dd58151d..798ffe87 100644
--- a/src/cmd/rc/lex.c
+++ b/src/cmd/rc/lex.c
@@ -233,9 +233,9 @@ int yylex(void){
if(nextis('[')){
*w++='[';
c=advance();
- *w++=c;
if(c<'0' || '9'<c){
RedirErr:
+ *w++ = c;
*w=0;
yyerror(t->type==PIPE?"pipe syntax"
:"redirection syntax");
@@ -266,6 +266,7 @@ int yylex(void){
t->rtype=CLOSE;
}
}
+ *w=0;
if(c!=']'
|| t->type==DUP && (t->rtype==HERE || t->rtype==APPEND))
goto RedirErr;
@@ -320,3 +321,4 @@ int yylex(void){
yylval.tree=t;
return t->type;
}
+