cmdline: display "[Return]" when there is no more token to complete
authorOlivier Matz <zer0@droids-corp.org>
Mon, 21 Feb 2011 22:59:14 +0000 (23:59 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 13 Mar 2011 10:09:25 +0000 (11:09 +0100)
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
src/lib/cmdline_parse.c

index 513c9f0..ceb22d6 100644 (file)
@@ -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;