From: Olivier Matz Date: Mon, 21 Feb 2011 22:59:14 +0000 (+0100) Subject: cmdline: display "[Return]" when there is no more token to complete X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0c04fc6ac5c90753ff582486e2602b7ed429623d;p=libcmdline.git cmdline: display "[Return]" when there is no more token to complete Signed-off-by: Olivier Matz --- 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;