about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Src/params.c b/Src/params.c
index 379d90729..65b3ecff8 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1302,16 +1302,18 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
 
 	if (v->isarr) {
 	    if (ishash) {
-		if (!pprog)
-		    return 1;
 		scanprog = pprog;
 		scanstr = s;
 		if (keymatch)
 		    v->isarr |= SCANPM_KEYMATCH;
-		else if (ind)
-		    v->isarr |= SCANPM_MATCHKEY;
-		else
-		    v->isarr |= SCANPM_MATCHVAL;
+		else {
+		    if (!pprog)
+			return 1;
+		    if (ind)
+			v->isarr |= SCANPM_MATCHKEY;
+		    else
+			v->isarr |= SCANPM_MATCHVAL;
+		}
 		if (down)
 		    v->isarr |= SCANPM_MATCHMANY;
 		if ((ta = getvaluearr(v)) &&