From bbb7fde3f0a5e5f1596df44b9154a6cd796c1e05 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 25 Feb 2010 12:03:28 -0500 Subject: [PATCH] archive_write_disk uses a series of chdir() operations to shorten path 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libarchive/archive_write_disk.c b/libarchive/archive_write_disk.c index fcab99612..5f5ade9de 100644 --- a/libarchive/archive_write_disk.c +++ b/libarchive/archive_write_disk.c @@ -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) { -- 2.47.3