]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
archive_write_disk uses a series of chdir() operations to shorten path
authorTim Kientzle <kientzle@gmail.com>
Thu, 25 Feb 2010 17:03:28 +0000 (12:03 -0500)
committerTim Kientzle <kientzle@gmail.com>
Thu, 25 Feb 2010 17:03:28 +0000 (12:03 -0500)
arguments to PATH_MAX.  If there is no PATH_MAX definition (as on
HURD), just skip this.

POSIX does provide a more complex way to deal with this concern using
fpathconf() to query the maximum relative pathname starting in any particular
directory.  Someday, this code should probably be augmented to use
that mechanism.

SVN-Revision: 1991

libarchive/archive_write_disk.c

index fcab99612b8719f9bd2f2403f668c3281f82c4e6..5f5ade9de941868f4e35fa57593ab76f3e251735 100644 (file)
@@ -465,7 +465,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry)
                if (ret != ARCHIVE_OK)
                        goto done;
        }
-#ifdef HAVE_FCHDIR
+#if defined(HAVE_FCHDIR) && defined(PATH_MAX)
        /* If path exceeds PATH_MAX, shorten the path. */
        edit_deep_directories(a);
 #endif
@@ -942,7 +942,7 @@ archive_write_disk_new(void)
  * object creation is likely to fail, but any error will get handled
  * at that time.
  */
-#ifdef HAVE_FCHDIR
+#if defined(HAVE_FCHDIR) && defined(PATH_MAX)
 static void
 edit_deep_directories(struct archive_write_disk *a)
 {