[Freeswitch-svn] [commit] r11559 - freeswitch/trunk/src/mod/languages/mod_lua

FreeSWITCH SVN mcollins at freeswitch.org
Thu Jan 29 15:39:47 PST 2009


Author: mcollins
Date: Thu Jan 29 17:39:47 2009
New Revision: 11559

Log:
Create empty argv table when no args are passed to a Lua script

Modified:
   freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp

Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua.cpp	Thu Jan 29 17:39:47 2009
@@ -156,7 +156,14 @@
 				error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 1);
 				switch_safe_free(code);
 			}
+		} else {
+			// Force empty argv table
+			char *code = NULL;
+			code = switch_mprintf("argv = {};");
+			error = luaL_loadbuffer(L, code, strlen(code), "line") || docall(L, 0, 1);
+			switch_safe_free(code);
 		}
+
 		if (!error) {
 			char *file = input_code, *fdup = NULL;
 



More information about the Freeswitch-svn mailing list