diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1999-04-07 22:57:47 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1999-04-07 22:57:47 +0000 |
commit | 66900c733ccef6a01b8fc6d7ca9f5f9adac7656a (patch) | |
tree | f8d21da2f215bd13dc3d8473209b287975535406 /env.c | |
parent | 69b56c86fb2139aeba8d842f3f158aa4a88d9a5e (diff) | |
download | fetchmail-66900c733ccef6a01b8fc6d7ca9f5f9adac7656a.tar.gz fetchmail-66900c733ccef6a01b8fc6d7ca9f5f9adac7656a.tar.bz2 fetchmail-66900c733ccef6a01b8fc6d7ca9f5f9adac7656a.zip |
First round of post-5.0.0 buglets.
svn path=/trunk/; revision=2430
Diffstat (limited to 'env.c')
-rw-r--r-- | env.c | 31 |
1 files changed, 15 insertions, 16 deletions
@@ -40,23 +40,22 @@ void envquery(int argc, char **argv) else program_name = argv[0]; - if ((user = getenv("USER")) == (char *)NULL) - user = getenv("LOGNAME"); - - if ((user == (char *)NULL) || (home = getenv("HOME")) == (char *)NULL) + if ((pw = getpwuid(getuid())) != NULL) { - if ((pw = getpwuid(getuid())) != NULL) - { - user = pw->pw_name; - home = pw->pw_dir; - } - else - { - fprintf(stderr, - _("%s: can't find your name and home directory!\n"), - program_name); - exit(PS_UNDEFINED); - } + user = pw->pw_name; + home = pw->pw_dir; + } + else if ((home = getenv("HOME"))) + { + if ((user = getenv("LOGNAME")) == (char *)NULL || user[0] == '\0') + user = getenv("USER"); + } + else + { + fprintf(stderr, + _("%s: can't find your name and home directory!\n"), + program_name); + exit(PS_UNDEFINED); } #define RCFILE_NAME ".fetchmailrc" |