mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-14 13:51:31 +00:00
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.
This commit is contained in:
parent
5579fb5240
commit
e274946528
1 changed files with 16 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue