1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Escape backtick in mac terminal notifications

This commit is contained in:
James Booth 2014-08-04 21:41:17 +01:00
parent 1809064d29
commit f18bfc3396

View File

@ -217,10 +217,12 @@ _notify(const char * const message, int timeout,
#ifdef HAVE_OSXNOTIFY #ifdef HAVE_OSXNOTIFY
GString *notify_command = g_string_new("terminal-notifier -title \"Profanity\" -message \""); GString *notify_command = g_string_new("terminal-notifier -title \"Profanity\" -message \"");
char *escaped = str_replace(message, "\"", "\\\""); char *escaped_double = str_replace(message, "\"", "\\\"");
g_string_append(notify_command, escaped); char *escaped_single = str_replace(escaped_double, "`", "\\`");
g_string_append(notify_command, escaped_single);
g_string_append(notify_command, "\""); g_string_append(notify_command, "\"");
free(escaped); free(escaped_double);
free(escaped_single);
char *term_name = getenv("TERM_PROGRAM"); char *term_name = getenv("TERM_PROGRAM");
char *app_id = NULL; char *app_id = NULL;