diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-06-29 15:24:06 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-06-29 15:24:06 -0300 |
commit | e869d17eb1309bfd81802a21b546a76e7ed6c38a (patch) | |
tree | 31981e2682a6f4b1197a06e0490bbd9cfc7ee47c /lstrlib.c | |
parent | 9a0221ef5887b25bb5e8cc734cedd7418250c8cd (diff) | |
download | lua-e869d17eb1309bfd81802a21b546a76e7ed6c38a.tar.gz lua-e869d17eb1309bfd81802a21b546a76e7ed6c38a.tar.bz2 lua-e869d17eb1309bfd81802a21b546a76e7ed6c38a.zip |
functions should return explicit "nil"s.
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.15 1998/06/19 16:14:09 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.16 1998/06/24 13:33:00 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 | */ |
@@ -346,6 +346,7 @@ static void str_find (void) | |||
346 | if (s2) { | 346 | if (s2) { |
347 | lua_pushnumber(s2-s+1); | 347 | lua_pushnumber(s2-s+1); |
348 | lua_pushnumber(s2-s+strlen(p)); | 348 | lua_pushnumber(s2-s+strlen(p)); |
349 | return; | ||
349 | } | 350 | } |
350 | } | 351 | } |
351 | else { | 352 | else { |
@@ -363,6 +364,7 @@ static void str_find (void) | |||
363 | } | 364 | } |
364 | } while (s1++<cap.src_end && !anchor); | 365 | } while (s1++<cap.src_end && !anchor); |
365 | } | 366 | } |
367 | lua_pushnil(); /* if arives here, it didn't find */ | ||
366 | } | 368 | } |
367 | 369 | ||
368 | 370 | ||