Skip to content
Snippets Groups Projects
Commit e2749465 authored by wolfs's avatar wolfs
Browse files

Call I_mkdir on subdirectories [NEEDS CLEANUP]

I got lazy and used a weird inefficient method, but I don't know how to clean this mess up :c At least it works.
parent 5579fb52
No related branches found
No related tags found
Loading
......@@ -182,6 +182,22 @@ static int io_open (lua_State *L) {
return pushresult(L,0,filename);
}
I_mkdir("luafiles", 0755);
char *splitter = filename;
while ((splitter = strchr(splitter, '/')))
{
*splitter = 0;
I_mkdir(va("luafiles"PATHSEP"%s", filename), 0755);
*splitter = '/';
splitter++;
}
char *splitter2 = filename;
while ((splitter2 = strchr(splitter2, '\\')))
{
*splitter2 = 0;
I_mkdir(va("luafiles"PATHSEP"%s", filename), 0755);
*splitter2 = '\\';
splitter2++;
}
char* destFilename = va("luafiles"PATHSEP"%s", filename);
filename = destFilename;
const char *mode = luaL_optstring(L, 2, "r");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment