diff options
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.9 1998/03/06 16:54:42 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.10 1998/03/06 18:47:42 roberto Exp roberto $ |
3 | ** Standard library for strings and pattern-matching | 3 | ** Standard library for strings and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -286,7 +286,7 @@ static char *match (char *s, char *p, struct Capture *cap) | |||
286 | switch (*ep) { | 286 | switch (*ep) { |
287 | case '*': { /* repetition */ | 287 | case '*': { /* repetition */ |
288 | char *res; | 288 | char *res; |
289 | if (s1 && (res = match(s1, p, cap))) | 289 | if (s1 && s1>s && (res = match(s1, p, cap))) |
290 | return res; | 290 | return res; |
291 | p=ep+1; goto init; /* else return match(s, ep+1, cap); */ | 291 | p=ep+1; goto init; /* else return match(s, ep+1, cap); */ |
292 | } | 292 | } |
@@ -300,7 +300,7 @@ static char *match (char *s, char *p, struct Capture *cap) | |||
300 | char *res; | 300 | char *res; |
301 | if ((res = match(s, ep+1, cap)) != 0) | 301 | if ((res = match(s, ep+1, cap)) != 0) |
302 | return res; | 302 | return res; |
303 | else if (s1) { | 303 | else if (s1 && s1>s) { |
304 | s = s1; | 304 | s = s1; |
305 | goto init; /* return match(s1, p, cap); */ | 305 | goto init; /* return match(s1, p, cap); */ |
306 | } | 306 | } |