From c223d1bc6bd5850a887025f23464829faa77f643 Mon Sep 17 00:00:00 2001 From: Davide Italiano Date: Wed, 16 Nov 2016 19:35:36 +0000 Subject: [ELF] Don't replace path separators on *NIX. Apparently this is wrong because it's legal to have a filename on UNIX which contains a backslash. Differential Revision: https://reviews.llvm.org/D26734 llvm-svn: 287143 --- lld/lib/Core/Reproduce.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lld/lib/Core/Reproduce.cpp') diff --git a/lld/lib/Core/Reproduce.cpp b/lld/lib/Core/Reproduce.cpp index a6f5019702e..5ff668e64fc 100644 --- a/lld/lib/Core/Reproduce.cpp +++ b/lld/lib/Core/Reproduce.cpp @@ -53,7 +53,9 @@ static void writeMember(raw_fd_ostream &OS, StringRef Path, StringRef Data) { // Converts path to use unix path separators so the cpio can be extracted on // both unix and windows. static void convertToUnixPathSeparator(SmallString<128> &Path) { +#ifdef LLVM_ON_WIN32 std::replace(Path.begin(), Path.end(), '\\', '/'); +#endif } void CpioFile::append(StringRef Path, StringRef Data) { -- cgit v1.2.3