Don't unlink the target file if it's not a regular file.

This commit is contained in:
Dag-Erling Smørgrav 2000-08-31 11:24:15 +00:00
parent bb2083983f
commit e2b41a622b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65277

View File

@ -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;