diff options
author | William Jon McCann <jmccann@redhat.com> | 2010-04-02 20:20:24 -0400 |
---|---|---|
committer | William Jon McCann <jmccann@redhat.com> | 2010-04-02 20:20:24 -0400 |
commit | 3806c8e7f9ff5cc534d56d92ef64057af1ed9316 (patch) | |
tree | a5f24f77f496dd124dec82d65517bdf2e487b1fb | |
parent | 5b3f2617d28f63598793bdb0761e5d406499b2fb (diff) | |
download | libnotify-3806c8e7f9ff5cc534d56d92ef64057af1ed9316.tar.gz |
Replace escape characters with g_strcompress in body
https://bugzilla.gnome.org/show_bug.cgi?id=613999
-rw-r--r-- | tools/notify-send.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/notify-send.c b/tools/notify-send.c index 684cf91..e1831f4 100644 --- a/tools/notify-send.c +++ b/tools/notify-send.c @@ -125,7 +125,7 @@ int main (int argc, char *argv[]) { static const char *summary = NULL; - static const char *body = ""; + char *body; static const char *type = NULL; static char *icon_str = NULL; static char *icons = NULL; @@ -167,6 +167,8 @@ main (int argc, char *argv[]) {NULL} }; + body = NULL; + g_type_init (); g_set_prgname (argv[0]); @@ -197,7 +199,7 @@ main (int argc, char *argv[]) } if (n_text[1] != NULL) { - body = n_text[1]; + body = g_strcompress (n_text[1]); if (n_text[2] != NULL) { fprintf (stderr, "%s\n", @@ -219,12 +221,17 @@ main (int argc, char *argv[]) if (!notify_init ("notify-send")) exit (1); - notify = notify_notification_new (summary, body, icon_str, NULL); + notify = notify_notification_new (summary, + body == NULL ? "" : body, + icon_str, + NULL); notify_notification_set_category (notify, type); notify_notification_set_urgency (notify, urgency); notify_notification_set_timeout (notify, expire_timeout); - // Set hints + g_free (body); + + /* Set hints */ if (hints != NULL) { gint i = 0; gint l; |