aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/pending/tar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/toys/pending/tar.c b/toys/pending/tar.c
index 97524d87..8fb047bf 100644
--- a/toys/pending/tar.c
+++ b/toys/pending/tar.c
@@ -373,7 +373,11 @@ static void extract_to_disk(void)
char *name = TT.hdr.name;
int ala = TT.hdr.mode;
- if (dirflush(name)) return;
+ if (dirflush(name)) {
+ if (S_ISREG(ala) && !TT.hdr.link_target) skippy(TT.hdr.size);
+
+ return;
+ }
// create path before file if necessary
if (strrchr(name, '/') && mkpath(name) && errno !=EEXIST)