diff --git a/external/ppr b/external/ppr index 2129af3..f921861 160000 --- a/external/ppr +++ b/external/ppr @@ -1 +1 @@ -Subproject commit 2129af37ff96ea3c99db78fc16dc08562354a97c +Subproject commit f9218619766942366adc6443869aafd8350fb79e diff --git a/src/dir.c b/src/dir.c index 72b883a..c53fbd6 100644 --- a/src/dir.c +++ b/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);