Support escaping delimiters in MANGOHUD_CONFIG

pull/58/head
jackun 4 years ago
parent 417b1aac8d
commit 9a4c9033fa
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -182,8 +182,15 @@ parse_string(const char *s, char *out_param, char *out_value)
if (*s == '=') {
s++;
i++;
for (; !is_delimiter(*s); s++, out_value++, i++)
for (; !is_delimiter(*s); s++, out_value++, i++) {
*out_value = *s;
// Consume escaped delimiter, but don't escape null. Might be end of string.
if (*s == '\\' && *(s + 1) != 0 && is_delimiter(*(s + 1))) {
s++;
i++;
*out_value = *s;
}
}
} else
*(out_value++) = '1';
*out_value = 0;

Loading…
Cancel
Save