diff options
author | David Barksdale <amatus.amongus@gmail.com> | 2013-05-13 22:44:38 -0500 |
---|---|---|
committer | David Barksdale <amatus.amongus@gmail.com> | 2013-05-13 22:44:38 -0500 |
commit | 061658db2e0523f7326ad8bb9e2073bf011388e4 (patch) | |
tree | b9767d285c8938fc1cf3e6373a58d7457c8a7c5f /tools | |
parent | 5427aa88d5930655ef9e958446489acc1bf9a160 (diff) |
For some reason the hasPath() test is failing on an archive created the libtool where each file starts with ".libs/". Seems safe enough to just always try to create directories. Not tested on any other archives.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-ar/llvm-ar.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/llvm-ar/llvm-ar.cpp b/tools/llvm-ar/llvm-ar.cpp index 86eb8e272f..477422c7c1 100644 --- a/tools/llvm-ar/llvm-ar.cpp +++ b/tools/llvm-ar/llvm-ar.cpp @@ -461,17 +461,15 @@ doExtract(std::string* ErrMsg) { (std::find(Paths.begin(), Paths.end(), I->getPath()) != Paths.end())) { // Make sure the intervening directories are created - if (I->hasPath()) { - sys::Path dirs(I->getPath()); - dirs.eraseComponent(); - if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) - return true; - } + sys::Path dirs(I->getPath()); + dirs.eraseComponent(); + if (dirs.createDirectoryOnDisk(/*create_parents=*/true, ErrMsg)) + return true; // Open up a file stream for writing std::ios::openmode io_mode = std::ios::out | std::ios::trunc | std::ios::binary; - std::ofstream file(I->getPath().c_str(), io_mode); + std::ofstream file(I->getPath().c_str(), io_mode); // TODO: Test that file is valid // Get the data and its length const char* data = reinterpret_cast<const char*>(I->getData()); |