diff options
-rw-r--r-- | lstrlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.105 2004/08/06 17:35:38 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.106 2004/08/09 13:30:33 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -250,7 +250,7 @@ static int matchbracketclass (int c, const char *p, const char *ec) { | |||
250 | while (++p < ec) { | 250 | while (++p < ec) { |
251 | if (*p == ESC) { | 251 | if (*p == ESC) { |
252 | p++; | 252 | p++; |
253 | if (match_class(c, *p)) | 253 | if (match_class(c, uchar(*p))) |
254 | return sig; | 254 | return sig; |
255 | } | 255 | } |
256 | else if ((*(p+1) == '-') && (p+2 < ec)) { | 256 | else if ((*(p+1) == '-') && (p+2 < ec)) { |
@@ -267,7 +267,7 @@ static int matchbracketclass (int c, const char *p, const char *ec) { | |||
267 | static int luaI_singlematch (int c, const char *p, const char *ep) { | 267 | static int luaI_singlematch (int c, const char *p, const char *ep) { |
268 | switch (*p) { | 268 | switch (*p) { |
269 | case '.': return 1; /* matches any char */ | 269 | case '.': return 1; /* matches any char */ |
270 | case ESC: return match_class(c, *(p+1)); | 270 | case ESC: return match_class(c, uchar(*(p+1))); |
271 | case '[': return matchbracketclass(c, p, ep-1); | 271 | case '[': return matchbracketclass(c, p, ep-1); |
272 | default: return (uchar(*p) == c); | 272 | default: return (uchar(*p) == c); |
273 | } | 273 | } |
@@ -393,7 +393,7 @@ static const char *match (MatchState *ms, const char *s, const char *p) { | |||
393 | } | 393 | } |
394 | default: { | 394 | default: { |
395 | if (isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ | 395 | if (isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ |
396 | s = match_capture(ms, s, *(p+1)); | 396 | s = match_capture(ms, s, uchar(*(p+1))); |
397 | if (s == NULL) return NULL; | 397 | if (s == NULL) return NULL; |
398 | p+=2; goto init; /* else return match(ms, s, p+2) */ | 398 | p+=2; goto init; /* else return match(ms, s, p+2) */ |
399 | } | 399 | } |