From dae1cf2420b4b432651219a7d9e025b844aed7c2 Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 28 Dec 2011 16:34:09 +0100 Subject: it's now possible to use quoting in shellexec commands, for example: shellexec.02 xdg-open "http://youtube.com/results?search_query=%a+%t":find on youtube:find_on_youtube:single --- plugins/shellexec/shellexec.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'plugins/shellexec') diff --git a/plugins/shellexec/shellexec.c b/plugins/shellexec/shellexec.c index 76d31e34..d7aa45c6 100644 --- a/plugins/shellexec/shellexec.c +++ b/plugins/shellexec/shellexec.c @@ -121,6 +121,20 @@ shx_get_actions (DB_playItem_t *it) return (DB_plugin_action_t *)actions; } +static char * +shx_find_sep (char *str) { + while (*str && *str != ':') { + if (*str == '"') { + str++; + while (*str && *str !='"') { + str++; + } + } + str++; + } + return str; +} + static int shx_start () { @@ -141,7 +155,7 @@ shx_start () int idx = 0; char *p = tmp; while (idx < 4 && p) { - char *e = strchr (p, ':'); + char *e = shx_find_sep (p); args[idx++] = p; if (!e) { break; -- cgit v1.2.3