aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-29 10:51:50 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-29 10:51:50 +0200
commite419d484245bf20f01c4b04da78cd15fbaac6366 (patch)
treea254b2975e54db43c2957a19898aeaa61e1b19db
parent39e089cc057f141ed440635493a041dc321eb2c3 (diff)
downloadvis-e419d484245bf20f01c4b04da78cd15fbaac6366.tar.gz
vis-e419d484245bf20f01c4b04da78cd15fbaac6366.tar.xz
sam: use more suitable error message if no command is given
-rw-r--r--sam.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sam.c b/sam.c
index 0c1ffee..f3b4242 100644
--- a/sam.c
+++ b/sam.c
@@ -493,8 +493,10 @@ static const CommandDef *command_lookup(Vis *vis, const char *name) {
}
static Command *command_parse(Vis *vis, const char **s, int level, enum SamError *err) {
- if (!**s)
+ if (!**s) {
+ *err = SAM_ERR_COMMAND;
return NULL;
+ }
Command *cmd = command_new(NULL);
if (!cmd)
return NULL;