Mercurial > trustbridge
diff cinst/mozilla.c @ 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 | 6fa0e12ae1d2 |
children | 8fafd0fc2173 344b8a79ad2e |
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; }