commit ae528208910cdfa1d71ad82de9f65b8c32b23397
parent e13f571d119cdd6fedef3f748a264bb143cecc70
Author: Eivind Uggedal <eivind@uggedal.com>
Date: Mon, 15 Feb 2016 14:00:00 +0000
tar: make remove(3) non-fatal when extracting
Handles special cases like: .
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tar.c b/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));