Unbreak all archive reading operations introduced by the last patch which
authorReid Spencer <rspencer@reidspencer.com>
Wed, 15 Dec 2004 21:58:03 +0000 (21:58 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Wed, 15 Dec 2004 21:58:03 +0000 (21:58 +0000)
always exited the program with exit code 1 in these cases, regardless of
whether an error occurred or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18966 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-ar/llvm-ar.cpp

index 586639bd631d776bd6f0d73559ed9518b1300576..1755e18413efc98722cdf257b0d65301d08c702f 100644 (file)
@@ -679,10 +679,11 @@ int main(int argc, char **argv) {
     } else {
       std::string Error;
       TheArchive = Archive::OpenAndLoad(ArchivePath, &Error);
-      if (TheArchive == 0)
+      if (TheArchive == 0) {
         std::cerr << argv[0] << ": error loading '" << ArchivePath << "': "
                   << Error << "!\n";
-      return 1;
+        return 1;
+      }
     }
 
     // Make sure we're not fooling ourselves.