lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 383a6e88f93c88973d14ac1c2dc85ff36bc2cbdc
parent 871166d7dbe987dafc074e5e55802202ec2a1963
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 29 Jan 2003 11:23:23 -0200

argv[0] may be NULL

Diffstat:
Mlua.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lua.c b/lua.c @@ -1,5 +1,5 @@ /* -** $Id: lua.c,v 1.114 2003/01/17 15:27:28 roberto Exp roberto $ +** $Id: lua.c,v 1.115 2003/01/29 10:27:07 roberto Exp roberto $ ** Lua stand-alone interpreter ** See Copyright Notice in lua.h */ @@ -397,7 +397,7 @@ static int pmain (lua_State *l) { struct Smain *s = (struct Smain *)lua_touserdata(l, 1); int status; int interactive = 0; - if (s->argv[0][0] != '\0') progname = s->argv[0]; + if (s->argv[0] && s->argv[0][0]) progname = s->argv[0]; L = l; lua_userinit(l); /* open libraries */ status = handle_luainit();