diff options
Diffstat (limited to 'common/path.c')
-rw-r--r-- | common/path.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/common/path.c b/common/path.c index 818befc..0ff1431 100644 --- a/common/path.c +++ b/common/path.c @@ -49,7 +49,6 @@ #include <string.h> #ifdef OS_UNIX -#include <paths.h> #include <pwd.h> #include <unistd.h> #endif @@ -135,41 +134,6 @@ expand_homedir (const char *remainder) } } -static char * -expand_tempdir (const char *remainder) -{ - const char *env; - - if (remainder[0] == '\0') - remainder = NULL; - - env = getenv ("TEMP"); - if (env && env[0]) { - return p11_path_build (env, remainder, NULL); - - } else { -#ifdef OS_UNIX -#ifdef _PATH_TMP - return p11_path_build (_PATH_TMP, remainder, NULL); -#else - return p11_path_build ("/tmp", remainder, NULL); -#endif - -#else /* OS_WIN32 */ - char directory[MAX_PATH + 1]; - - if (!GetTempPathA (MAX_PATH + 1, directory)) { - p11_message ("couldn't lookup temp directory"); - errno = ENOTDIR; - return NULL; - } - - return p11_path_build (directory, remainder, NULL); - -#endif /* OS_WIN32 */ - } -} - static inline bool is_path_component_or_null (char ch) { @@ -189,14 +153,6 @@ p11_path_expand (const char *path) is_path_component_or_null (path[1])) { return expand_homedir (path + 1); - } else if (strncmp (path, "$HOME", 5) == 0 && - is_path_component_or_null (path[5])) { - return expand_homedir (path + 5); - - } else if (strncmp (path, "$TEMP", 5) == 0 && - is_path_component_or_null (path[5])) { - return expand_tempdir (path + 5); - } else { return strdup (path); } |