Mercurial > trustbridge
changeset 177:c92297bcda8f
dirent d_type is not supported on Windows, so use new port_isdir().
FWIW, according to the man page d_type isn't guarantied to work for
all file systems on linux neither.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Tue, 25 Mar 2014 16:48:18 +0100 |
parents | 70d627e9e801 |
children | b0579d4fa186 344b8a79ad2e |
files | cinst/mozilla.c |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/cinst/mozilla.c Tue Mar 25 16:45:32 2014 +0100 +++ b/cinst/mozilla.c Tue Mar 25 16:48:18 2014 +0100 @@ -170,7 +170,6 @@ get_profile_inis () { char **inis = NULL; -#ifndef _WIN32 char path[LINEBUFLEN]; char *fqpath; DIR *mozdir; @@ -192,7 +191,11 @@ { while ((mozdirent = readdir(mozdir)) != NULL) { - if (mozdirent->d_type == DT_DIR) + snprintf(path, LINEBUFLEN, "%s/%s/%s", + home, + "/.mozilla", + mozdirent->d_name); + if (port_isdir(path)) { snprintf(path, LINEBUFLEN, "%s/%s/%s/%s", home, @@ -222,7 +225,6 @@ fprintf(stderr, "Windows not yet supported"); abort(); } -#endif return inis; }