From 0c04fc6ac5c90753ff582486e2602b7ed429623d Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Mon, 21 Feb 2011 23:59:14 +0100 Subject: [PATCH] cmdline: display "[Return]" when there is no more token to complete Signed-off-by: Olivier Matz --- src/lib/cmdline_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/cmdline_parse.c b/src/lib/cmdline_parse.c index 513c9f0..ceb22d6 100644 --- a/src/lib/cmdline_parse.c +++ b/src/lib/cmdline_parse.c @@ -312,7 +312,7 @@ match_inst(cmdline_parse_inst_t *inst, const char *linebuf, linebuf++; /* end of buf, we match all inst */ - if (isendofline(*linebuf) || iscomment(*linebuf)) + if (*linebuf == '\0' || isendofline(*linebuf) || iscomment(*linebuf)) return 0; /* garbage after inst */ @@ -489,7 +489,7 @@ int cmdline_help(cmdline_parse_ctx_t *ctx, const char *buf, /* end of inst */ if (token == NULL) { - n = snprintf(helpbuf, sizeof(helpbuf), "[RETURN]\n"); + n = snprintf(helpbuf, sizeof(helpbuf), "[Return]\n"); if (n > 0) write_buf(opaque, helpbuf, n); continue; -- 2.20.1