summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/fetch/fetch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index d72814b..b33fb03 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -385,7 +385,8 @@ fetch(char *URL, char *path)
stat_end(&xs);
/* Set mtime of local file */
- if (!n_flag && us.mtime && !o_stdout) {
+ if (!n_flag && us.mtime && !o_stdout
+ && (stat(path, &sb) != -1) && sb.st_mode & S_IFREG) {
struct timeval tv[2];
fflush(of);
OpenPOWER on IntegriCloud