Don't unlink the target file if it's not a regular file.
This commit is contained in:
parent
bb2083983f
commit
e2b41a622b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user