aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2000-08-31 11:24:15 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2000-08-31 11:24:15 +0000
commite2b41a622b724944b4cd25b9516814c50d96419c (patch)
tree2b1e853ac4680eb7b3e974a4257a49e30c398fab /usr.bin
parentbb2083983f695fcba15167e7139270175ed3ce50 (diff)
Notes
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 ad605bf921e8..d72814b8ba08 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -427,7 +427,8 @@ fetch(char *URL, char *path)
goto done;
failure:
if (of && of != stdout && !R_flag && !r_flag)
- unlink(path);
+ if (stat(path, &sb) != -1 && (sb.st_mode & S_IFREG))
+ unlink(path);
failure_keep:
r = -1;
goto done;