]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/libregexp/regcomp.c
libregexp: fix lexer so it doesnt move past the string when it gets a \ escape
[plan9front.git] / sys / src / libregexp / regcomp.c
index 094f947794c3e6b9b275d6ce64c8fdc7881dbee4..c7b3b9b870385f52a24cca568267f36538faa7ab 100644 (file)
@@ -312,13 +312,10 @@ getnextr(Parselex *l)
                return;
        }
        l->rawexp += chartorune(&l->rune, l->rawexp);
-       if(l->rune == L'\\') {
-               l->rawexp += chartorune(&l->rune, l->rawexp);
-               l->literal = 1;
-       }
        if(*l->rawexp == 0)
                l->done = 1;
-       return;
+       if(l->rune == L'\\')
+               getnextrlit(l);
 }
 
 static void
@@ -333,7 +330,6 @@ getnextrlit(Parselex *l)
        l->rawexp += chartorune(&l->rune, l->rawexp);
        if(*l->rawexp == 0)
                l->done = 1;
-       return;
 }
 
 static int