summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-02 14:48:48 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-02 14:48:48 (GMT)
commite9bc469b2abcd0ad4cb3ad4bfefbc5ef1f559c1b (patch)
tree7e84ef0666764bcad5e77c9955c7dcd13413b427 /Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
parentdb9c40b4f5c9e1aadfe11c89040bad1e3b386162 (diff)
parent501345e470bb9c5b0cb61aff84bd50ffdd95b92d (diff)
downloadCMake-e9bc469b2abcd0ad4cb3ad4bfefbc5ef1f559c1b.zip
CMake-e9bc469b2abcd0ad4cb3ad4bfefbc5ef1f559c1b.tar.gz
CMake-e9bc469b2abcd0ad4cb3ad4bfefbc5ef1f559c1b.tar.bz2
Merge branch 'upstream-LibArchive' into update-libarchive
Resolve conflicts in C code by taking their side. Resolve conflicts in CMake code by integrating the changes.
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
index 450ac75..5946683 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
@@ -2386,6 +2386,9 @@ check_symlinks(struct archive_write_disk *a)
while ((*pn != '\0') && (*p == *pn))
++p, ++pn;
}
+ /* Skip the root directory if the path is absolute. */
+ if(pn == a->name && pn[0] == '/')
+ ++pn;
c = pn[0];
/* Keep going until we've checked the entire name. */
while (pn[0] != '\0' && (pn[0] != '/' || pn[1] != '\0')) {
@@ -2447,6 +2450,9 @@ check_symlinks(struct archive_write_disk *a)
return (ARCHIVE_FAILED);
}
}
+ pn[0] = c;
+ if (pn[0] != '\0')
+ pn++; /* Advance to the next segment. */
}
pn[0] = c;
/* We've checked and/or cleaned the whole path, so remember it. */