diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-02-09 16:51:19 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-02-09 16:51:19 +0000 |
commit | 34af4adde1c65495fa8948c482ef83bd73204d89 (patch) | |
tree | 28a5032cc2ff7188a24115f58bdce117a7e2d9ec | |
parent | 91906eeb746d96a39560471e92431a0c6632c70a (diff) | |
download | xine-lib-34af4adde1c65495fa8948c482ef83bd73204d89.tar.gz xine-lib-34af4adde1c65495fa8948c482ef83bd73204d89.tar.bz2 |
Remove some unnecessary tests (which the compiler would discard).
-rw-r--r-- | src/xine-utils/utils.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index c5f18a699..cc3ffdc2c 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -324,22 +324,18 @@ const char *xine_get_homedir(void) { char *s; int len; - if (!homedir[0]) { - len = xine_strcpy_command(GetCommandLine(), homedir, sizeof(homedir)); - s = strdup(homedir); - GetFullPathName(s, sizeof(homedir), homedir, NULL); - free(s); - if ((s = strrchr(homedir, '\\'))) *s = '\0'; - } + len = xine_strcpy_command(GetCommandLine(), homedir, sizeof(homedir)); + s = strdup(homedir); + GetFullPathName(s, sizeof(homedir), homedir, NULL); + free(s); + if ((s = strrchr(homedir, '\\'))) + *s = '\0'; return homedir; #else struct passwd pwd, *pw = NULL; static char homedir[BUFSIZ] = {0,}; - if(homedir[0]) - return homedir; - #ifdef HAVE_GETPWUID_R if(getpwuid_r(getuid(), &pwd, homedir, sizeof(homedir), &pw) != 0 || pw == NULL) { #else |