]> Pileus Git - ~andy/fetchmail/commitdiff
Don't assign garbage to parsetime if using - (stdin) for rcfile.
authorMatthias Andree <matthias.andree@gmx.de>
Sun, 28 Feb 2010 12:54:39 +0000 (13:54 +0100)
committerMatthias Andree <matthias.andree@gmx.de>
Sun, 28 Feb 2010 13:12:04 +0000 (14:12 +0100)
fetchmail.c

index 43c1e98c6174f4e3b03653971c91e489a1c2380f..b74c88972b93191af4a6ddc09d8a5b0aef4d1fe9 100644 (file)
@@ -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)