update
This commit is contained in:
parent
b65cb44ff0
commit
7b017bcf3f
2 changed files with 10 additions and 2 deletions
2
external/ppr
vendored
2
external/ppr
vendored
|
|
@ -1 +1 @@
|
|||
Subproject commit 2129af37ff96ea3c99db78fc16dc08562354a97c
|
||||
Subproject commit f9218619766942366adc6443869aafd8350fb79e
|
||||
10
src/dir.c
10
src/dir.c
|
|
@ -34,7 +34,11 @@ static void dir_recursion(const char* path, const char* path2, void* tv) {
|
|||
|
||||
if(d->d_name[0] == '.') continue;
|
||||
|
||||
#ifdef _WIN32
|
||||
new_de.path = ppr_strvacat(path, strchr(path, '/') != NULL ? "/" : "\\", d->d_name, NULL);
|
||||
#else
|
||||
new_de.path = ppr_strvacat(path, "/", d->d_name, NULL);
|
||||
#endif
|
||||
new_de.d = *d;
|
||||
ppr_stat(new_de.path, &new_de.s);
|
||||
arrput(de, new_de);
|
||||
|
|
@ -44,9 +48,13 @@ static void dir_recursion(const char* path, const char* path2, void* tv) {
|
|||
if(de != NULL) {
|
||||
qsort(de, arrlen(de), sizeof(*de), sort_de);
|
||||
for(i = 0; i < arrlen(de); i++) {
|
||||
#ifdef _WIN32
|
||||
char* p = ppr_strvacat(de[i].d.d_name, PPR_S_ISDIR(de[i].s.st_mode) ? (strchr(de[i].d.d_fullname, '/') != NULL ? "/" : "\\") : "", NULL);
|
||||
#else
|
||||
char* p = ppr_strvacat(de[i].d.d_name, PPR_S_ISDIR(de[i].s.st_mode) ? "/" : "", NULL);
|
||||
#endif
|
||||
|
||||
dir_recursion(de[i].path, p, tv);
|
||||
//dir_recursion(de[i].path, p, tv);
|
||||
|
||||
free(p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue