From 468fbdbde749d5fe221adebf115f9594067b8da4 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 24 Jun 1998 10:33:00 -0300 Subject: details --- lstrlib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index 58fbd708..72188723 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.14 1998/05/31 22:20:45 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.15 1998/06/19 16:14:09 roberto Exp roberto $ ** Standard library for strings and pattern-matching ** See Copyright Notice in lua.h */ @@ -302,19 +302,19 @@ static char *match (char *s, char *p, struct Capture *cap) switch (*ep) { case '*': { /* repetition */ char *res; - if (s1 && s1>s && (res = match(s1, p, cap))) + if (s1 && s1>s && ((res=match(s1, p, cap)) != NULL)) return res; p=ep+1; goto init; /* else return match(s, ep+1, cap); */ } case '?': { /* optional */ char *res; - if (s1 && (res = match(s1, ep+1, cap))) + if (s1 && ((res=match(s1, ep+1, cap)) != NULL)) return res; p=ep+1; goto init; /* else return match(s, ep+1, cap); */ } case '-': { /* repetition */ char *res; - if ((res = match(s, ep+1, cap)) != 0) + if ((res = match(s, ep+1, cap)) != NULL) return res; else if (s1 && s1>s) { s = s1; -- cgit v1.2.3-55-g6feb