r492 - trunk

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Feb 19 20:12:55 EST 2008


Author: icculus
Date: 2008-02-19 20:12:47 -0500 (Tue, 19 Feb 2008)
New Revision: 492

Modified:
   trunk/lua_glue.c
Log:
MojoSetup.cmdlinestr()'s optional arguments can be explicitly nil, too.


Modified: trunk/lua_glue.c
===================================================================
--- trunk/lua_glue.c	2008-02-15 10:51:22 UTC (rev 491)
+++ trunk/lua_glue.c	2008-02-20 01:12:47 UTC (rev 492)
@@ -698,8 +698,8 @@
 {
     const int argc = lua_gettop(L);
     const char *arg = luaL_checkstring(L, 1);
-    const char *envr = (argc < 2) ? NULL : luaL_checkstring(L, 2);
-    const char *deflt = (argc < 3) ? NULL : luaL_checkstring(L, 3);
+    const char *envr = (argc < 2) ? NULL : lua_tostring(L, 2);  // may be nil
+    const char *deflt = (argc < 3) ? NULL : lua_tostring(L, 3);  // may be nil
     return retvalString(L, cmdlinestr(arg, envr, deflt));
 } // luahook_cmdlinestr
 




More information about the mojosetup-commits mailing list