File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 2323
2424static void createSubfolders (const char * fileName )
2525{
26- FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate ();
27-
26+ char path [PATH_MAX ];
2827 char * token = NULL ;
28+ char * pathTail = path ;
2929 while ((token = strchr (fileName , '/' )) != NULL )
3030 {
31- ffStrbufAppendNS (& path , (uint32_t )(token - fileName + 1 ), fileName );
32- mkdir (path .chars , S_IRWXU | S_IRGRP | S_IROTH );
31+ uint32_t length = (uint32_t )(token - fileName + 1 );
32+ memcpy (pathTail , fileName , length );
33+ pathTail += length ;
34+ * pathTail = 0 ;
35+ mkdir (path , S_IRWXU | S_IRGRP | S_IROTH );
3336 fileName = token + 1 ;
3437 }
3538}
Original file line number Diff line number Diff line change 88
99static void createSubfolders (const char * fileName )
1010{
11- FF_STRBUF_AUTO_DESTROY path = ffStrbufCreate () ;
11+ char path [ MAX_PATH ] ;
1212 char * token = NULL ;
13+ char * pathTail = path ;
1314 while ((token = strchr (fileName , '/' )) != NULL )
1415 {
15- ffStrbufAppendNS (& path , (uint32_t )(token - fileName + 1 ), fileName );
16- CreateDirectoryA (path .chars , NULL );
16+ uint32_t length = (uint32_t )(token - fileName + 1 );
17+ memcpy (pathTail , fileName , length );
18+ pathTail += length ;
19+ * pathTail = 0 ;
20+ CreateDirectoryA (path , NULL );
1721 fileName = token + 1 ;
1822 }
1923}
You can’t perform that action at this time.
0 commit comments