about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-08-04 21:41:17 +0100
committerJames Booth <boothj5@gmail.com>2014-08-04 21:41:17 +0100
commitf18bfc3396fe0c94d106ecaef18af9656b494f16 (patch)
treebedd4801401509a9359687739b70d34de8b3759c
parent1809064d298fb5c25d6afefd3d715c242516c13d (diff)
downloadprofani-tty-f18bfc3396fe0c94d106ecaef18af9656b494f16.tar.gz
Escape backtick in mac terminal notifications
-rw-r--r--src/ui/notifier.c8
1 files 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;