mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 20:01:53 +00:00
Better escaping.
This commit is contained in:
parent
6f95eec905
commit
122a6b7e28
@ -1000,7 +1000,9 @@ string escape(const char *src) {
|
||||
if (*src == '\\')
|
||||
dst += "\\\\";
|
||||
else if (*src == '"')
|
||||
dst += '2'; // Yes, this IS a trick ;)
|
||||
dst += "\\2"; // Yes, this IS a trick ;)
|
||||
else if (*src == ' ')
|
||||
dst += "\\s";
|
||||
else
|
||||
dst += *src;
|
||||
src++;
|
||||
@ -1018,11 +1020,13 @@ string unescape(const char *src) {
|
||||
if (*src == '\\') {
|
||||
if (*next_char == 0) // This is an error...
|
||||
dst += '\\';
|
||||
else if (*next_char == '2') {
|
||||
dst += '"';
|
||||
src++;
|
||||
} else {
|
||||
dst += *next_char;
|
||||
else {
|
||||
if (*next_char == '2')
|
||||
dst += '"';
|
||||
else if (*next_char == 's')
|
||||
dst += ' ';
|
||||
else
|
||||
dst += *next_char;
|
||||
src++;
|
||||
}
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user