functions should return explicit "nil"s.

This commit is contained in:
Roberto Ierusalimschy
1998-06-29 15:24:06 -03:00
parent 9a0221ef58
commit e869d17eb1
2 changed files with 11 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lstrlib.c,v 1.15 1998/06/19 16:14:09 roberto Exp roberto $
** $Id: lstrlib.c,v 1.16 1998/06/24 13:33:00 roberto Exp roberto $
** Standard library for strings and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -346,6 +346,7 @@ static void str_find (void)
if (s2) {
lua_pushnumber(s2-s+1);
lua_pushnumber(s2-s+strlen(p));
return;
}
}
else {
@@ -363,6 +364,7 @@ static void str_find (void)
}
} while (s1++<cap.src_end && !anchor);
}
lua_pushnil(); /* if arives here, it didn't find */
}