summaryrefslogtreecommitdiff
path: root/plugins/shellexec
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-12-28 16:34:09 +0100
committerGravatar waker <wakeroid@gmail.com>2011-12-28 16:34:09 +0100
commitdae1cf2420b4b432651219a7d9e025b844aed7c2 (patch)
treece63db36f422ecb442691978bde18c0136744c88 /plugins/shellexec
parent95d053827971a857f7dc755306ced0311cf00a47 (diff)
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
Diffstat (limited to 'plugins/shellexec')
-rw-r--r--plugins/shellexec/shellexec.c16
1 files changed, 15 insertions, 1 deletions
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;