mirror of
git://git.suckless.org/sbase
synced 2024-12-23 23:43:33 +00:00
tar: make remove(3) non-fatal when extracting
Handles special cases like: .
This commit is contained in:
parent
e13f571d11
commit
ae52820891
2
tar.c
2
tar.c
@ -259,7 +259,7 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ])
|
||||
if (!mflag && ((mtime = strtol(h->mtime, &p, 8)) < 0 || *p != '\0'))
|
||||
eprintf("strtol %s: invalid number\n", h->mtime);
|
||||
if (remove(fname) < 0 && errno != ENOENT)
|
||||
eprintf("remove %s:", fname);
|
||||
weprintf("remove %s:", fname);
|
||||
|
||||
tmp = estrdup(fname);
|
||||
mkdirp(dirname(tmp));
|
||||
|
Loading…
Reference in New Issue
Block a user