aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-06-09 20:51:50 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2000-06-09 20:51:50 +0000
commit0c137ed4490d18da77c9f2230abad4a63cbcb53e (patch)
tree2c26d1f87e2a4c9e3a47a3980a29dfa4667fb613 /tar.c
parent8b84e3bb8f7b8e5bcfdd57dda61514bdbc8ea98b (diff)
downloadbusybox-w32-0c137ed4490d18da77c9f2230abad4a63cbcb53e.tar.gz
busybox-w32-0c137ed4490d18da77c9f2230abad4a63cbcb53e.tar.bz2
busybox-w32-0c137ed4490d18da77c9f2230abad4a63cbcb53e.zip
* 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 <kevin@netmaster.com> for helping track this one down. -Erik git-svn-id: svn://busybox.net/trunk/busybox@633 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tar.c b/tar.c
index 7d440f451..86f996576 100644
--- a/tar.c
+++ b/tar.c
@@ -300,11 +300,14 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
300 300
301 /* Open the file to be written, if a file is supposed to be written */ 301 /* Open the file to be written, if a file is supposed to be written */
302 if (extractFlag==TRUE && tostdoutFlag==FALSE) { 302 if (extractFlag==TRUE && tostdoutFlag==FALSE) {
303 if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, header->mode & ~S_IFMT)) < 0)
304 errorMsg(io_error, header->name, strerror(errno));
305 /* Create the path to the file, just in case it isn't there... 303 /* Create the path to the file, just in case it isn't there...
306 * This should not screw up path permissions or anything. */ 304 * This should not screw up path permissions or anything. */
307 createPath(header->name, 0777); 305 createPath(header->name, 0777);
306 if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY,
307 header->mode & ~S_IFMT)) < 0) {
308 errorMsg(io_error, header->name, strerror(errno));
309 return( FALSE);
310 }
308 } 311 }
309 312
310 /* Write out the file, if we are supposed to be doing that */ 313 /* Write out the file, if we are supposed to be doing that */