File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed
Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 2323
2424static void createSubfolders (const char * fileName )
2525{
26- char path [PATH_MAX ];
26+ FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate ();
27+
2728 char * token = NULL ;
28- char * pathTail = path ;
2929 while ((token = strchr (fileName , '/' )) != NULL )
3030 {
31- uint32_t length = (uint32_t )(token - fileName + 1 );
32- pathTail = ffStrCopyN (pathTail , fileName , length );
33- mkdir (path , S_IRWXU | S_IRGRP | S_IROTH );
31+ ffStrbufAppendNS (& path , (uint32_t )(token - fileName + 1 ), fileName );
32+ mkdir (path .chars , S_IRWXU | S_IRGRP | S_IROTH );
3433 fileName = token + 1 ;
3534 }
3635}
Original file line number Diff line number Diff line change 88
99static void createSubfolders (const char * fileName )
1010{
11- char path [ MAX_PATH ] ;
11+ FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate () ;
1212 char * token = NULL ;
13- char * pathTail = path ;
1413 while ((token = strchr (fileName , '/' )) != NULL )
1514 {
16- uint32_t length = (uint32_t )(token - fileName + 1 );
17- pathTail = ffStrCopyN (pathTail , fileName , length );
18- CreateDirectoryA (path , NULL );
15+ ffStrbufAppendNS (& path , (uint32_t )(token - fileName + 1 ), fileName );
16+ CreateDirectoryA (path .chars , NULL );
1917 fileName = token + 1 ;
2018 }
2119}
You can’t perform that action at this time.
0 commit comments