tcorrect command-printing bug - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 168518a993a67436d00c40f4f9cea68a296a2034
 (DIR) parent 6a8f21b2cc4d8d3b1eabfd504b6a0a050149523e
 (HTM) Author: rsc <devnull@localhost>
       Date:   Fri, 18 Mar 2005 18:54:54 +0000
       
       correct command-printing bug
       
       Diffstat:
         M src/cmd/rc/lex.c                    |       4 +++-
       
       1 file changed, 3 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/src/cmd/rc/lex.c b/src/cmd/rc/lex.c
       t@@ -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");
       t@@ -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;
       t@@ -320,3 +321,4 @@ int yylex(void){
                yylval.tree=t;
                return t->type;
        }
       +