Skip to content

Commit 9d1fc92

Browse files
committed
Revert "TarWriter: Only use 137 of the 155 prefix bytes."
This reverts commit 90d6ed1. Breaks check-llvm. Revert while I investigate.
1 parent d931b09 commit 9d1fc92

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

llvm/lib/Support/TarWriter.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,7 @@ static bool splitUstar(StringRef Path, StringRef &Prefix, StringRef &Name) {
131131
return true;
132132
}
133133

134-
// tar 1.13 and earlier unconditionally look at the tar header interpreted
135-
// as an 'oldgnu_header', which has an 'isextended' byte at offset 482 in the
136-
// header, corresponding to offset 137 in the prefix. That's the version of
137-
// tar in gnuwin, so only use 137 of the 155 bytes in the prefix. This means
138-
// we'll need a pax header after 237 bytes of path instead of after 255,
139-
// but in return paths up to 237 bytes work with gnuwin, instead of just
140-
// 137 bytes of directory + 100 bytes of basename previously.
141-
// (tar-1.13 also doesn't support pax headers, but in practice all paths in
142-
// llvm's test suite are short enough for that to not matter.)
143-
const int MaxPrefix = 137;
144-
size_t Sep = Path.rfind('/', MaxPrefix + 1);
134+
size_t Sep = Path.rfind('/', sizeof(UstarHeader::Prefix) + 1);
145135
if (Sep == StringRef::npos)
146136
return false;
147137
if (Path.size() - Sep - 1 >= sizeof(UstarHeader::Name))

0 commit comments

Comments
 (0)