From e419d484245bf20f01c4b04da78cd15fbaac6366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 29 May 2016 10:51:50 +0200 Subject: sam: use more suitable error message if no command is given --- sam.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sam.c') 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; -- cgit v1.2.3