Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/common/io/io_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@

static void createSubfolders(const char* fileName)
{
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate();

char path[PATH_MAX];
char *token = NULL;
char *pathTail = path;
while((token = strchr(fileName, '/')) != NULL)
{
ffStrbufAppendNS(&path, (uint32_t)(token - fileName + 1), fileName);
mkdir(path.chars, S_IRWXU | S_IRGRP | S_IROTH);
uint32_t length = (uint32_t)(token - fileName + 1);
pathTail = ffStrCopyN(pathTail, fileName, length);
mkdir(path, S_IRWXU | S_IRGRP | S_IROTH);
fileName = token + 1;
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/common/io/io_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

static void createSubfolders(const char* fileName)
{
FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate();
char path[MAX_PATH];
char *token = NULL;
char *pathTail = path;
while((token = strchr(fileName, '/')) != NULL)
{
ffStrbufAppendNS(&path, (uint32_t)(token - fileName + 1), fileName);
CreateDirectoryA(path.chars, NULL);
uint32_t length = (uint32_t)(token - fileName + 1);
pathTail = ffStrCopyN(pathTail, fileName, length);
CreateDirectoryA(path, NULL);
fileName = token + 1;
}
}
Expand Down
Loading