Handle spaces and quotes in file names in MRI scripts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220364 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2014-10-22 03:10:56 +00:00
parent f9ebe0ad75
commit 230b53fd1b
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
; RUN: echo create %t.a > %t.mri
; RUN: echo addmod %p/Inputs/trivial-object-test.elf-x86-64 >> %t.mri
; RUN: echo "addmod \"%p/Inputs/trivial-object-test.elf-x86-64\" " >> %t.mri
; RUN: echo save >> %t.mri
; RUN: echo end >> %t.mri

View 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)