mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-27 13:40:30 +00:00
teach EscapeString and UnescapeString to handle ".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69211 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8818b8f443
commit
d7fd2126c2
@ -77,6 +77,7 @@ void llvm::UnescapeString(std::string &Str) {
|
||||
case 'r': Str[i] = '\r'; break;
|
||||
case 't': Str[i] = '\t'; break;
|
||||
case 'v': Str[i] = '\v'; break;
|
||||
case '"': Str[i] = '\"'; break;
|
||||
case '\'': Str[i] = '\''; break;
|
||||
case '\\': Str[i] = '\\'; break;
|
||||
}
|
||||
@ -96,6 +97,8 @@ void llvm::EscapeString(std::string &Str) {
|
||||
} else if (Str[i] == '\t') {
|
||||
Str[i++] = '\\';
|
||||
Str.insert(Str.begin()+i, 't');
|
||||
} else if (Str[i] == '"') {
|
||||
Str.insert(Str.begin()+i++, '\\');
|
||||
} else if (Str[i] == '\n') {
|
||||
Str[i++] = '\\';
|
||||
Str.insert(Str.begin()+i, 'n');
|
||||
|
Loading…
Reference in New Issue
Block a user