From cdd8c4b9a1544b64f2176df64dd7e24a2e08b74a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Thu, 26 Jan 2017 20:40:05 +0100 Subject: sam: disallow destructive commands in groups and looping constructs This should fix segfaults for commands like `:{ q i/foo/ }` or `:x/pattern/ q` where a command invalidates the current window. The checks are a bit too strict, for example a destructive command at the end of a non-nested group would be fine, but is currently also rejected. --- sam.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sam.h') diff --git a/sam.h b/sam.h index 0ea9c2f..e94b175 100644 --- a/sam.h +++ b/sam.h @@ -18,6 +18,8 @@ enum SamError { SAM_ERR_MARK, SAM_ERR_CONFLICT, SAM_ERR_WRITE_CONFLICT, + SAM_ERR_LOOP_INVALID_CMD, + SAM_ERR_GROUP_INVALID_CMD, }; bool sam_init(Vis*); -- cgit v1.2.3