Escape backslashes and quotes in symbol name strings
This commit is contained in:
parent
84f939ab4d
commit
e11515fb74
4 changed files with 191 additions and 0 deletions
|
|
@ -411,8 +411,10 @@ class CCodeGenerator {
|
|||
}
|
||||
|
||||
string sanitize_name_for_string(string name) {
|
||||
util::str_replace(&name, "\\", "\\\\");
|
||||
util::str_replace(&name, "\n", "\\n");
|
||||
util::str_replace(&name, "\r", "\\r");
|
||||
util::str_replace(&name, "\"", "\\\"");
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue