diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2010-02-28 13:54:39 +0100 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2010-02-28 14:12:04 +0100 |
commit | 0ab9e62bac91144906d4680c000a75f75d9b6622 (patch) | |
tree | aeae0f3188c256ec18bcd6d87e40bb5bd8b15baa /fetchmail.c | |
parent | d5d433e0c051cb0912421a1df3f239438928f7d2 (diff) | |
download | fetchmail-0ab9e62bac91144906d4680c000a75f75d9b6622.tar.gz fetchmail-0ab9e62bac91144906d4680c000a75f75d9b6622.tar.bz2 fetchmail-0ab9e62bac91144906d4680c000a75f75d9b6622.zip |
Don't assign garbage to parsetime if using - (stdin) for rcfile.
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fetchmail.c b/fetchmail.c index 43c1e98c..b74c8897 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1032,11 +1032,14 @@ static int load_params(int argc, char **argv, int optind) } /* note the parse time, so we can pick up on modifications */ - parsetime = 0; /* foil compiler warnings */ - if (strcmp(rcfile, "-") == 0 || stat(rcfile, &rcstat) != -1) - parsetime = rcstat.st_mtime; - else if (errno != ENOENT) - report(stderr, GT_("couldn't time-check the run-control file\n")); + if (strcmp(rcfile, "-") == 0) + parsetime = time(NULL); + else { + if (stat(rcfile, &rcstat) != -1) + parsetime = rcstat.st_mtime; + else if (errno != ENOENT) + report(stderr, GT_("couldn't time-check the run-control file\n")); + } /* this builds the host list */ if ((st = prc_parse_file(rcfile, !versioninfo)) != 0) |