mirror of
https://github.com/ep00ch/lwip-contrib-mac.git
synced 2024-07-04 15:29:30 +00:00
First parse subdirectories, then files (to get main directory to the front of the list)
This commit is contained in:
parent
deec441987
commit
268bb23f11
@ -186,21 +186,6 @@ int process_sub(FILE *data_file, FILE *struct_file)
|
|||||||
int filesProcessed = 0;
|
int filesProcessed = 0;
|
||||||
char oldSubdir[MAX_PATH_LEN];
|
char oldSubdir[MAX_PATH_LEN];
|
||||||
|
|
||||||
fret = FINDFIRST_FILE("*.*", &fInfo);
|
|
||||||
if (FINDFIRST_SUCCEEDED(fret)) {
|
|
||||||
/* at least one file in directory */
|
|
||||||
do {
|
|
||||||
if (FIND_T_IS_FILE(fInfo)) {
|
|
||||||
const char *curName = FIND_T_FILENAME(fInfo);
|
|
||||||
printf("processing %s/%s..." NEWLINE, curSubdir, curName);
|
|
||||||
if (process_file(data_file, struct_file, curName) < 0) {
|
|
||||||
printf(NEWLINE "Error... aborting" NEWLINE);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
filesProcessed++;
|
|
||||||
}
|
|
||||||
} while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo)));
|
|
||||||
}
|
|
||||||
if (processSubs) {
|
if (processSubs) {
|
||||||
/* process subs recursively */
|
/* process subs recursively */
|
||||||
strcpy(oldSubdir, curSubdir);
|
strcpy(oldSubdir, curSubdir);
|
||||||
@ -222,6 +207,22 @@ int process_sub(FILE *data_file, FILE *struct_file)
|
|||||||
} while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo)));
|
} while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fret = FINDFIRST_FILE("*.*", &fInfo);
|
||||||
|
if (FINDFIRST_SUCCEEDED(fret)) {
|
||||||
|
/* at least one file in directory */
|
||||||
|
do {
|
||||||
|
if (FIND_T_IS_FILE(fInfo)) {
|
||||||
|
const char *curName = FIND_T_FILENAME(fInfo);
|
||||||
|
printf("processing %s/%s..." NEWLINE, curSubdir, curName);
|
||||||
|
if (process_file(data_file, struct_file, curName) < 0) {
|
||||||
|
printf(NEWLINE "Error... aborting" NEWLINE);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
filesProcessed++;
|
||||||
|
}
|
||||||
|
} while (FINDNEXT_SUCCEEDED(FINDNEXT(fret, &fInfo)));
|
||||||
|
}
|
||||||
return filesProcessed;
|
return filesProcessed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user