about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 04ef1a4fb..dac536f14 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -1828,6 +1828,10 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags)
 			quotemod = 1;
 			quotetype = QT_SINGLE_OPTIONAL;
 		    } else {
+			if (quotetype == QT_SINGLE_OPTIONAL) {
+			    /* extra q's after '-' not allowed */
+			    goto flagerr;
+			}
 			quotemod++, quotetype++;
 		    }
 		    break;