Handle spaces and quotes in file names in MRI scripts.
[oota-llvm.git] / tools / llvm-ar / llvm-ar.cpp
index 8411a1dad476ce02d779d7d06ce20062a9863eed..6858a94b36bd75d7fe1d376dfe7bf6d05bc5a45c 100644 (file)
@@ -961,6 +961,9 @@ static void runMRIScript() {
     StringRef Line = *I;
     StringRef CommandStr, Rest;
     std::tie(CommandStr, Rest) = Line.split(' ');
+    Rest = Rest.trim();
+    if (!Rest.empty() && Rest.front() == '"' && Rest.back() == '"')
+      Rest = Rest.drop_front().drop_back();
     auto Command = StringSwitch<MRICommand>(CommandStr.lower())
                        .Case("addlib", MRICommand::AddLib)
                        .Case("addmod", MRICommand::AddMod)