From f18bfc3396fe0c94d106ecaef18af9656b494f16 Mon Sep 17 00:00:00 2001 From: James Booth Date: Mon, 4 Aug 2014 21:41:17 +0100 Subject: Escape backtick in mac terminal notifications --- src/ui/notifier.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ui/notifier.c b/src/ui/notifier.c index b7f2eb81..abc64cae 100644 --- a/src/ui/notifier.c +++ b/src/ui/notifier.c @@ -217,10 +217,12 @@ _notify(const char * const message, int timeout, #ifdef HAVE_OSXNOTIFY GString *notify_command = g_string_new("terminal-notifier -title \"Profanity\" -message \""); - char *escaped = str_replace(message, "\"", "\\\""); - g_string_append(notify_command, escaped); + char *escaped_double = str_replace(message, "\"", "\\\""); + char *escaped_single = str_replace(escaped_double, "`", "\\`"); + g_string_append(notify_command, escaped_single); g_string_append(notify_command, "\""); - free(escaped); + free(escaped_double); + free(escaped_single); char *term_name = getenv("TERM_PROGRAM"); char *app_id = NULL; -- cgit 1.4.1-2-gfad0