change method to find '/' as the suggestion of @sheinz
This commit is contained in:
parent
028bc01414
commit
8be2c20a4f
1 changed files with 3 additions and 7 deletions
|
|
@ -199,13 +199,9 @@ static bool process_directory(const char *direcotry)
|
||||||
}
|
}
|
||||||
sprintf(path, "%s/%s", direcotry, ep->d_name);
|
sprintf(path, "%s/%s", direcotry, ep->d_name);
|
||||||
filename = path;
|
filename = path;
|
||||||
file_ptr = path;
|
filename = strchr(path, '/');
|
||||||
while(*file_ptr != 0 && *file_ptr != '/') {
|
filename = filename ? &filename[1] : path;
|
||||||
file_ptr ++;
|
|
||||||
}
|
|
||||||
if(*file_ptr != 0) {
|
|
||||||
filename = file_ptr + 1;
|
|
||||||
}
|
|
||||||
printf("Processing file source %s, dest: %s\n", path, filename);
|
printf("Processing file source %s, dest: %s\n", path, filename);
|
||||||
if (!process_file(path, filename)) {
|
if (!process_file(path, filename)) {
|
||||||
printf("Error processing file\n");
|
printf("Error processing file\n");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue