[llvm] 9d1fc92 - Revert "TarWriter: Only use 137 of the 155 prefix bytes."
Nico Weber via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 10:34:22 PDT 2020
Author: Nico Weber
Date: 2020-04-27T13:34:04-04:00
New Revision: 9d1fc92b144924fd9b9078b0abc2ad203dbe70c3
URL: https://github.com/llvm/llvm-project/commit/9d1fc92b144924fd9b9078b0abc2ad203dbe70c3
DIFF: https://github.com/llvm/llvm-project/commit/9d1fc92b144924fd9b9078b0abc2ad203dbe70c3.diff
LOG: Revert "TarWriter: Only use 137 of the 155 prefix bytes."
This reverts commit 90d6ed144c1352e393556a799e79da6ec3a5fab9.
Breaks check-llvm. Revert while I investigate.
Added:
Modified:
llvm/lib/Support/TarWriter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Support/TarWriter.cpp b/llvm/lib/Support/TarWriter.cpp
index c7a744f0fc98..6c62f8861afd 100644
--- a/llvm/lib/Support/TarWriter.cpp
+++ b/llvm/lib/Support/TarWriter.cpp
@@ -131,17 +131,7 @@ static bool splitUstar(StringRef Path, StringRef &Prefix, StringRef &Name) {
return true;
}
- // tar 1.13 and earlier unconditionally look at the tar header interpreted
- // as an 'oldgnu_header', which has an 'isextended' byte at offset 482 in the
- // header, corresponding to offset 137 in the prefix. That's the version of
- // tar in gnuwin, so only use 137 of the 155 bytes in the prefix. This means
- // we'll need a pax header after 237 bytes of path instead of after 255,
- // but in return paths up to 237 bytes work with gnuwin, instead of just
- // 137 bytes of directory + 100 bytes of basename previously.
- // (tar-1.13 also doesn't support pax headers, but in practice all paths in
- // llvm's test suite are short enough for that to not matter.)
- const int MaxPrefix = 137;
- size_t Sep = Path.rfind('/', MaxPrefix + 1);
+ size_t Sep = Path.rfind('/', sizeof(UstarHeader::Prefix) + 1);
if (Sep == StringRef::npos)
return false;
if (Path.size() - Sep - 1 >= sizeof(UstarHeader::Name))
More information about the llvm-commits
mailing list