diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2018-11-09 01:45:54 -0600 |
---|---|---|
committer | Iain Lane <iainl@gnome.org> | 2019-02-15 12:54:39 +0000 |
commit | 9862ab85e8ea3c9d51b05de8a1d2e9a564b764ea (patch) | |
tree | d4e902668a209e606bf88a9406a83a5a36fa31c0 /tools | |
parent | 3f71a3b3baa8912edf9df86b0dfe1733095402a0 (diff) | |
download | libnotify-9862ab85e8ea3c9d51b05de8a1d2e9a564b764ea.tar.gz |
notify-send: allow passing colon as hint value
While some hints like image-path or sound-file supports parameters using the
file:// protocol, it's impossible to pass such hints to notify-send, because
it splits the passed argument so that it can have an unlimited number of colons,
while only 3 should be there (as per TYPE:NAME:VALUE format).
So, make `g_strsplit` to accept only 3 tokens as maximum, while pass the
remaining parameters all-together.
So now it's possible to do
notify-send -h string:image-path:file:///usr/share/icons/foo.png
Diffstat (limited to 'tools')
-rw-r--r-- | tools/notify-send.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/notify-send.c b/tools/notify-send.c index abfffe6..67e0b03 100644 --- a/tools/notify-send.c +++ b/tools/notify-send.c @@ -246,7 +246,7 @@ main (int argc, char *argv[]) char **tokens = NULL; while ((hint = hints[i++])) { - tokens = g_strsplit (hint, ":", -1); + tokens = g_strsplit (hint, ":", 3); l = g_strv_length (tokens); if (l != 3) { |