diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-11-19 17:08:00 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-11-19 17:08:00 +0000 |
commit | 6405c9ec9f76fd9b8a3b35d2408a74485dc5d00a (patch) | |
tree | d62e310720c00381696fbdf95e9df57546274a4c /lib/Archive/ArchiveWriter.cpp | |
parent | 7b73a663bcf6e88c166dcd4516656d9b3a8e9c85 (diff) |
Correct the computation of when to add the padding. It is not based on the
member's size. It is based on the oddness/evenness of the file pointer.
This fixes a bug with llvm-ar not being able to read archives produced by
llvm-ranlib when there are members with odd long file name lengths.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive/ArchiveWriter.cpp')
-rw-r--r-- | lib/Archive/ArchiveWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp index bd9851eb59..c3c7d12676 100644 --- a/lib/Archive/ArchiveWriter.cpp +++ b/lib/Archive/ArchiveWriter.cpp @@ -290,7 +290,7 @@ Archive::writeMember( ARFile.write(data,fSize); // Make sure the member is an even length - if (ARFile.tellp() % 2 != 0) + if (ARFile.tellp() & 1 == 1) ARFile << ARFILE_PAD; // Free the compressed data, if necessary |