]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 2 Nov 2011 17:06:38 +0000 (12:06 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 2 Nov 2011 17:06:38 +0000 (12:06 -0500)
src/mod/languages/mod_lua/mod_lua.cpp

index a165795cb04a0a4d1deda95cea98610503a92c5c..abeb847550687001b6ccf0e90c292ad86c0e2f95 100644 (file)
@@ -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) {