From 0c6a970eb26edf7e77e7c173d478b94100969fc4 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 9 Jun 2000 20:51:50 +0000 Subject: * Fixed a small bug that could cause tar to emit warning messages and not extract the first file in a directory in some cases of nested directories. Thanks to Kevin Traas for helping track this one down. -Erik --- archival/tar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'archival/tar.c') diff --git a/archival/tar.c b/archival/tar.c index 7d440f4..86f9965 100644 --- a/archival/tar.c +++ b/archival/tar.c @@ -300,11 +300,14 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) /* Open the file to be written, if a file is supposed to be written */ if (extractFlag==TRUE && tostdoutFlag==FALSE) { - if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, header->mode & ~S_IFMT)) < 0) - errorMsg(io_error, header->name, strerror(errno)); /* Create the path to the file, just in case it isn't there... * This should not screw up path permissions or anything. */ createPath(header->name, 0777); + if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, + header->mode & ~S_IFMT)) < 0) { + errorMsg(io_error, header->name, strerror(errno)); + return( FALSE); + } } /* Write out the file, if we are supposed to be doing that */ -- cgit v1.1