aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/rc/lex.c')
-rw-r--r--src/cmd/rc/lex.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/cmd/rc/lex.c b/src/cmd/rc/lex.c
index 9ca2453..3722606 100644
--- a/src/cmd/rc/lex.c
+++ b/src/cmd/rc/lex.c
@@ -142,8 +142,7 @@ putbyte(char *buf, int c)
return buf;
}
-static
-char *
+static char *
putrune(char *buf, int c)
{
buf = putbyte(buf, c);
@@ -184,7 +183,7 @@ isidentchar(int c)
int
yylex(void)
{
- int c, d = peekc();
+ int c, d = peekc();
Tree *node;
char *w = lexer.buf;
@@ -369,8 +368,15 @@ yylex(void)
}
for(;;){
- w = putrune(w, c);
- c = peekc();
+ switch(c){
+ /* inject a magic glob character into our stream */
+ case '*': case '[': case '?': case (int)GLOB:
+ w = putbyte(w, GLOB);
+ /* fallthrough */
+ default:
+ w = putrune(w, c);
+ c = peekc();
+ }
if(lexer.haddollar ? !isidentchar(c) : !iswordchar(c))
break;
advance();