diff options
author | James Booth <boothj5@gmail.com> | 2014-05-24 22:31:42 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-05-24 22:31:42 +0100 |
commit | 60b59d984a4576c780d56e9427248657776fdb01 (patch) | |
tree | 859301f2d3bdd5a8bd8c22857d23c35f8c88a840 | |
parent | b36fbe413a4a95c1ae75b99ca5d8cbde709bad6f (diff) | |
download | profani-tty-60b59d984a4576c780d56e9427248657776fdb01.tar.gz |
Escape strings passed to terminal-notifier
-rw-r--r-- | src/ui/notifier.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ui/notifier.c b/src/ui/notifier.c index 778487e2..04eb0130 100644 --- a/src/ui/notifier.c +++ b/src/ui/notifier.c @@ -212,9 +212,12 @@ _notify(const char * const message, int timeout, Shell_NotifyIcon(NIM_MODIFY, &nid); #endif #ifdef HAVE_OSXNOTIFY - GString *notify_command = g_string_new("terminal-notifier -title 'Profanity' -message '"); - g_string_append(notify_command, message); - g_string_append(notify_command, "'"); + GString *notify_command = g_string_new("terminal-notifier -title \"Profanity\" -message \""); + + char *escaped = str_replace(message, "\"", "\\\""); + g_string_append(notify_command, escaped); + g_string_append(notify_command, "\""); + free(escaped); char *term_name = getenv("TERM_PROGRAM"); char *app_id = NULL; |