aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-03-28 22:29:51 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-03 13:22:14 +0200
commitefdca4894b0219d4e4f618f911863811a2d6711e (patch)
treee4a1023ff9e75d1099be7270fa50f77be3e81450 /sam.c
parent9b9bb9130998e16ef75f4119cd02e52ed639c4ce (diff)
downloadvis-efdca4894b0219d4e4f618f911863811a2d6711e.tar.gz
vis-efdca4894b0219d4e4f618f911863811a2d6711e.tar.xz
sam: fix default regexp handling i.e. ':sam x'
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sam.c b/sam.c
index baaa365..0e94b8c 100644
--- a/sam.c
+++ b/sam.c
@@ -407,7 +407,7 @@ static Command *command_parse(Vis *vis, const char **s, int level, enum SamError
cmd->count = parse_number(s);
if (cmddef->flags & CMD_REGEX) {
- if (cmddef->flags & CMD_REGEX_DEFAULT && **s == ' ') {
+ if ((cmddef->flags & CMD_REGEX_DEFAULT) && (!**s || **s == ' ')) {
skip_spaces(s);
} else if (!(cmd->regex = parse_regex(vis, s))) {
*err = SAM_ERR_REGEX;