From 7717051e3ce062fbdb8415e4befa5205d25e80bb Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 15 May 2016 19:10:37 +0200 Subject: rc: fix inband globbing bugs, cleanup add glob information to the word structure so we wont accidently deglob quoted strings containing the GLOB. we store Globsize(word) in in word->glob which avoids recalculating that values and the check if a word should be globbed quick. globlist() now substitutes the word inplace avoiding the copying when all words are literals and avoids recursion. minor cleanups: use list2str() in execeval(), move octal() to unix.c, remove the (char*) casts to efree(). --- sys/src/cmd/rc/lex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sys/src/cmd/rc/lex.c') diff --git a/sys/src/cmd/rc/lex.c b/sys/src/cmd/rc/lex.c index fecd0ec64..fa364f18d 100644 --- a/sys/src/cmd/rc/lex.c +++ b/sys/src/cmd/rc/lex.c @@ -366,8 +366,7 @@ yylex(void) return c; } for(;;){ - /* next line should have (char)c==GLOB, but ken's compiler is broken */ - if(c=='*' || c=='[' || c=='?' || c==(unsigned char)GLOB) + if(c=='*' || c=='[' || c=='?' || c==GLOB) w = addtok(w, GLOB); w = addutf(w, c); c = nextc(); -- cgit v1.2.3