From 340039de464186386930e56306be0d5ea7558ed3 Mon Sep 17 00:00:00 2001 From: Daniel Carl Date: Tue, 12 Nov 2013 20:28:02 +0100 Subject: [PATCH] Fixed :qpush and :qunshift without parameters (#52). These commands should use current URI if they where called without any parameter, but cause of the migration of the way how we parse the inputbox, we got always a parameter or better right hand side. --- src/ex.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ex.c b/src/ex.c index e771ff2..f1689b9 100644 --- a/src/ex.c +++ b/src/ex.c @@ -764,7 +764,8 @@ static gboolean ex_open(const ExArg *arg) #ifdef FEATURE_QUEUE static gboolean ex_queue(const ExArg *arg) { - Arg a = {.s = arg->rhs->str}; + Arg a = {0}; + switch (arg->code) { case EX_QPUSH: a.i = COMMAND_QUEUE_PUSH; @@ -786,6 +787,12 @@ static gboolean ex_queue(const ExArg *arg) return false; } + /* if no argument is found in rhs, keep the uri in arg null to force + * command_queue() to use current URI */ + if (arg->rhs->len) { + a.s = arg->rhs->str; + } + return command_queue(&a); } #endif -- 2.20.1