[llvm-commits] [llvm] r95292 - in /llvm/trunk: lib/Archive/ArchiveReader.cpp test/Archive/MacOSX.toc
Chris Lattner
sabre at nondot.org
Wed Feb 3 22:19:44 PST 2010
Author: lattner
Date: Thu Feb 4 00:19:43 2010
New Revision: 95292
URL: http://llvm.org/viewvc/llvm-project?rev=95292&view=rev
Log:
>From PR6228:
"Attached patch removes the extra NUL bytes from the output and changes
test/Archive/MacOSX.toc from a binary to a text file (removes
svn:mime-type=application/octet-stream and adds svn:eol-style=native). I can't
figure out how to get SVN to include the new contents of the file in the patch
so I'm attaching it separately."
Patch by James Abbatiello!
Modified:
llvm/trunk/lib/Archive/ArchiveReader.cpp
llvm/trunk/test/Archive/MacOSX.toc
Modified: llvm/trunk/lib/Archive/ArchiveReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Archive/ArchiveReader.cpp?rev=95292&r1=95291&r2=95292&view=diff
==============================================================================
--- llvm/trunk/lib/Archive/ArchiveReader.cpp (original)
+++ llvm/trunk/lib/Archive/ArchiveReader.cpp Thu Feb 4 00:19:43 2010
@@ -120,7 +120,8 @@
if (Hdr->name[1] == '1' && Hdr->name[2] == '/') {
if (isdigit(Hdr->name[3])) {
unsigned len = atoi(&Hdr->name[3]);
- pathname.assign(At, len);
+ const char *nulp = (const char *)memchr(At, '\0', len);
+ pathname.assign(At, nulp != 0 ? nulp - At : len);
At += len;
MemberSize -= len;
flags |= ArchiveMember::HasLongFilenameFlag;
Modified: llvm/trunk/test/Archive/MacOSX.toc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Archive/MacOSX.toc?rev=95292&r1=95291&r2=95292&view=diff
==============================================================================
Binary files - no diff available.
More information about the llvm-commits
mailing list