cmdine:: allow non-final completion (will be used by file token)
[libcmdline.git] / src / lib / cmdline_parse.c
index 18ea76e..513c9f0 100644 (file)
@@ -542,7 +542,7 @@ int cmdline_help(cmdline_parse_ctx_t *ctx, const char *buf,
                while (token->ops->complete_iterate(token,
                                                    &preparse.opaque,
                                                    tmpbuf,
-                                                   sizeof(tmpbuf)) == 0) {
+                                                   sizeof(tmpbuf)) >= 0) {
 
 
                        debug_printf("   choice <%s>\n", tmpbuf);
@@ -641,7 +641,6 @@ cmdline_complete(cmdline_parse_ctx_t *ctx, const char *buf,
                        debug_printf("Completion %s\n", tmpbuf);
 
                        /* we kept at least the room for one char */
-                       /* XXX to be updated for non-final completion */
                        if (ret == 0)
                                strcat(tmpbuf, " ");