]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/scripting.c
fix: add missing #includes
[proxmark3-svn] / client / scripting.c
index df8d73bc2b5d8f9785785653f64f219bacf9fee9..0d491df76ab92f6d3560da1e2e36af890f0af158 100644 (file)
@@ -8,6 +8,7 @@
 // Some lua scripting glue to proxmark core.
 //-----------------------------------------------------------------------------
 
+#include <stdlib.h>
 #include <lua.h>
 #include <lualib.h>
 #include <lauxlib.h>
@@ -536,7 +537,11 @@ int set_pm3_libraries(lua_State *L)
 
        //-- Last but not least, add to the LUA_PATH (package.path in lua)
        // so we can load libraries from the ./lualib/ - directory
-       setLuaPath(L,"./lualibs/?.lua");
+       char libraries_path[strlen(get_my_executable_directory()) + strlen(LUA_LIBRARIES_DIRECTORY) + strlen(LUA_LIBRARIES_WILDCARD) + 1];
+       strcpy(libraries_path, get_my_executable_directory());
+       strcat(libraries_path, LUA_LIBRARIES_DIRECTORY);
+       strcat(libraries_path, LUA_LIBRARIES_WILDCARD);
+       setLuaPath(L, libraries_path);
 
        return 1;
 }
Impressum, Datenschutz