mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
parent
f18bfc3396
commit
cd9b1449b5
@ -219,7 +219,23 @@ _notify(const char * const message, int timeout,
|
|||||||
|
|
||||||
char *escaped_double = str_replace(message, "\"", "\\\"");
|
char *escaped_double = str_replace(message, "\"", "\\\"");
|
||||||
char *escaped_single = str_replace(escaped_double, "`", "\\`");
|
char *escaped_single = str_replace(escaped_double, "`", "\\`");
|
||||||
g_string_append(notify_command, escaped_single);
|
|
||||||
|
if (escaped_single[0] == '<') {
|
||||||
|
g_string_append(notify_command, "\\<");
|
||||||
|
g_string_append(notify_command, &escaped_single[1]);
|
||||||
|
} else if (escaped_single[0] == '[') {
|
||||||
|
g_string_append(notify_command, "\\[");
|
||||||
|
g_string_append(notify_command, &escaped_single[1]);
|
||||||
|
} else if (escaped_single[0] == '(') {
|
||||||
|
g_string_append(notify_command, "\\(");
|
||||||
|
g_string_append(notify_command, &escaped_single[1]);
|
||||||
|
} else if (escaped_single[0] == '{') {
|
||||||
|
g_string_append(notify_command, "\\{");
|
||||||
|
g_string_append(notify_command, &escaped_single[1]);
|
||||||
|
} else {
|
||||||
|
g_string_append(notify_command, escaped_single);
|
||||||
|
}
|
||||||
|
|
||||||
g_string_append(notify_command, "\"");
|
g_string_append(notify_command, "\"");
|
||||||
free(escaped_double);
|
free(escaped_double);
|
||||||
free(escaped_single);
|
free(escaped_single);
|
||||||
|
Loading…
Reference in New Issue
Block a user