From fe3a63fa6cdffa020e380d3e27cf0eb8f3b46b1f Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 6 Sep 2016 09:42:33 +0100 Subject: 39181: Add PM_SINGLE and use for compstate. This flags that compstate (or any other special) can only have a single instance and an attempt to create a new one is an error. Given the very fiddly semantics of compstate any other usage seems pointless. No investigation yet of other variables that could use this. Note it's still possible to hide such variables; only instances that keep the special nature are affected. --- Src/Zle/complete.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Src/Zle/complete.c') diff --git a/Src/Zle/complete.c b/Src/Zle/complete.c index b28b95ef9..4bf238fab 100644 --- a/Src/Zle/complete.c +++ b/Src/Zle/complete.c @@ -1238,8 +1238,9 @@ makecompparams(void) addcompparams(comprparams, comprpms); - if (!(cpm = createparam(COMPSTATENAME, - PM_SPECIAL|PM_REMOVABLE|PM_LOCAL|PM_HASHED))) + if (!(cpm = createparam( + COMPSTATENAME, + PM_SPECIAL|PM_REMOVABLE|PM_SINGLE|PM_LOCAL|PM_HASHED))) cpm = (Param) paramtab->getnode(paramtab, COMPSTATENAME); DPUTS(!cpm, "param not set in makecompparams"); -- cgit 1.4.1