sbase

suckless unix tools
git clone git://git.2f30.org/sbase.git
Log | Files | Refs | README | LICENSE

commit 713a051caa048f6251482a93472d26fc48147eda
parent 064159bc6e1673d3d2ef5b046ec646e2d4ec053c
Author: sin <sin@2f30.org>
Date:   Thu Apr 23 14:05:43 +0100

tar: Use remove() instead of unlink() so we can work on directories too

Diffstat:
tar.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tar.c b/tar.c @@ -201,7 +201,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 (unlink(fname) < 0 && errno != ENOENT && errno != EISDIR) + if (remove(fname) < 0 && errno != ENOENT) eprintf("unlink %s:", fname); tmp = estrdup(fname);