diff options
-rw-r--r-- | src/lib/eina/eina_vpath.c | 13 | ||||
-rw-r--r-- | src/lib/eina/eina_vpath.h | 4 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c index 0717e928e0..c06ee5abe8 100644 --- a/src/lib/eina/eina_vpath.c +++ b/src/lib/eina/eina_vpath.c @@ -195,11 +195,11 @@ eina_vpath_shutdown(void) return EINA_TRUE; } +#ifdef HAVE_GETPWENT static Eina_Bool _fetch_user_homedir(char **str, const char *name, const char *error) { *str = NULL; -#ifdef HAVE_GETPWENT struct passwd *pwent; pwent = getpwnam(name); @@ -211,12 +211,8 @@ _fetch_user_homedir(char **str, const char *name, const char *error) *str = pwent->pw_dir; return EINA_TRUE; -#else - ERR("User fetching is disabled on this system\nThe string was: %s", error); - return EINA_FALSE; - (void) name; -#endif } +#endif static int _eina_vpath_resolve(const char *path, char *str, size_t size) @@ -232,6 +228,10 @@ _eina_vpath_resolve(const char *path, char *str, size_t size) } // ~username/ <- homedir of user "username" else +#ifndef HAVE_GETPWENT + ERR("User fetching is disabled on this system\nThe string was: %s", path); + return 0; +#else { const char *p; char *name; @@ -248,6 +248,7 @@ _eina_vpath_resolve(const char *path, char *str, size_t size) return 0; path = p; } +#endif if (home) { return snprintf(str, size, "%s%s", home, path); diff --git a/src/lib/eina/eina_vpath.h b/src/lib/eina/eina_vpath.h index 77c1e35afe..10b7c1edf2 100644 --- a/src/lib/eina/eina_vpath.h +++ b/src/lib/eina/eina_vpath.h @@ -81,12 +81,14 @@ * * @since 1.21 * + * @note on Windows, vpath like ~bob/foo is not supported. + * */ typedef const char * Eina_Vpath; /** * Translate a virtual path into a normal path. - * + * * The return string is a string allocated by malloc and should be freed with * free() when no longer needed. * |