From: Anthony Minessale Date: Wed, 2 Nov 2011 17:06:38 +0000 (-0500) Subject: tweak X-Git-Tag: v1.2-rc1~27^2~245 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31152c68945e308d37b0c4fe997aa00421da8adc;p=thirdparty%2Ffreeswitch.git tweak --- diff --git a/src/mod/languages/mod_lua/mod_lua.cpp b/src/mod/languages/mod_lua/mod_lua.cpp index a165795cb0..abeb847550 100644 --- a/src/mod/languages/mod_lua/mod_lua.cpp +++ b/src/mod/languages/mod_lua/mod_lua.cpp @@ -135,9 +135,14 @@ static int lua_parse_and_execute(lua_State * L, char *input_code) return 1; } + while(input_code && (*input_code == ' ' || *input_code == '\n' || *input_code == '\r')) input_code++; + if (*input_code == '~') { char *buff = input_code + 1; error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 1, 0); //lua_pcall(L, 0, 0, 0); + } else if (!strncasecmp(input_code, "#!/lua", 6)) { + char *buff = input_code + 6; + error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 1, 0); //lua_pcall(L, 0, 0, 0); } else { char *args = strchr(input_code, ' '); if (args) {