aboutsummaryrefslogtreecommitdiff
path: root/tar.c
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-08-24 19:51:54 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-08-24 19:51:54 +0000
commit99a0ffbdeef90512689e5f954e5ba04a80a541e2 (patch)
tree5209668fde99a5caa4ed41d8d61c73770fcae646 /tar.c
parent75e73ce2e351a6c9d51e6bfcc3c1625dc434ba8a (diff)
downloadbusybox-w32-99a0ffbdeef90512689e5f954e5ba04a80a541e2.tar.gz
busybox-w32-99a0ffbdeef90512689e5f954e5ba04a80a541e2.tar.bz2
busybox-w32-99a0ffbdeef90512689e5f954e5ba04a80a541e2.zip
Canonicalize dirname(3) behavior.
git-svn-id: svn://busybox.net/trunk/busybox@3350 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'tar.c')
-rw-r--r--tar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tar.c b/tar.c
index cf65798ff..389d7f02e 100644
--- a/tar.c
+++ b/tar.c
@@ -342,9 +342,11 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag)
342 if (extractFlag==TRUE && tostdoutFlag==FALSE) { 342 if (extractFlag==TRUE && tostdoutFlag==FALSE) {
343 /* Create the path to the file, just in case it isn't there... 343 /* Create the path to the file, just in case it isn't there...
344 * This should not screw up path permissions or anything. */ 344 * This should not screw up path permissions or anything. */
345 char *dir = dirname (header->name); 345 char *buf, *dir;
346 buf = xstrdup (header->name);
347 dir = dirname (buf);
346 make_directory (dir, -1, FILEUTILS_RECUR); 348 make_directory (dir, -1, FILEUTILS_RECUR);
347 free (dir); 349 free (buf);
348 if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY, 350 if ((outFd=open(header->name, O_CREAT|O_TRUNC|O_WRONLY,
349 header->mode & ~S_IFMT)) < 0) { 351 header->mode & ~S_IFMT)) < 0) {
350 error_msg(io_error, header->name, strerror(errno)); 352 error_msg(io_error, header->name, strerror(errno));