diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-07-13 17:11:32 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-07-13 17:11:32 -0300 |
commit | 942496d767dff060250d5b45add0d9bf551843be (patch) | |
tree | be8bb1a0d432fddfd764cc2271507669320201d2 /lauxlib.c | |
parent | a535ad6fee6b0a5fc795dc1dfe8737b63b3684d8 (diff) | |
download | lua-942496d767dff060250d5b45add0d9bf551843be.tar.gz lua-942496d767dff060250d5b45add0d9bf551843be.tar.bz2 lua-942496d767dff060250d5b45add0d9bf551843be.zip |
small bug
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.119 2004/07/01 14:26:28 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.120 2004/07/09 18:23:17 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -383,9 +383,10 @@ static const char *luaL_gsub (lua_State *L, const char *s, | |||
383 | LUALIB_API const char *luaL_searchpath (lua_State *L, const char *name, | 383 | LUALIB_API const char *luaL_searchpath (lua_State *L, const char *name, |
384 | const char *path) { | 384 | const char *path) { |
385 | FILE *f; | 385 | FILE *f; |
386 | const char *p = path; | 386 | const char *p; |
387 | if (p == NULL) p = getpath(L); | 387 | if (path == NULL) path = getpath(L); |
388 | else lua_pushnil(L); /* to balance item pushed by `getpath' */ | 388 | else lua_pushnil(L); /* to balance item pushed by `getpath' */ |
389 | p = path; | ||
389 | for (;;) { | 390 | for (;;) { |
390 | const char *fname; | 391 | const char *fname; |
391 | if ((p = pushnexttemplate(L, p)) == NULL) { | 392 | if ((p = pushnexttemplate(L, p)) == NULL) { |