Skip to content
This repository was archived by the owner on Apr 15, 2025. It is now read-only.

Commit 846866e

Browse files
committed
Fix completion bug
1 parent 9dfbd48 commit 846866e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

bitlab/src/cli.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,9 @@ char** cli_completion(const char* text, int start, int end)
214214
spaces++;
215215

216216
// check if the input starts with "help" and allow for one space
217-
if ((strncmp(line, "help", 4) == 0) && (spaces <= 1))
217+
if (((strncmp(line, "help", 4) == 0) && (spaces <= 1)) || (spaces <= 0))
218218
return rl_completion_matches(text, cli_command_generator);
219-
else
220-
return NULL;
221-
222-
return rl_completion_matches(text, cli_command_generator);
219+
return NULL;
223220
}
224221

225222
char* cli_command_generator(const char* text, int state)

0 commit comments

Comments
 (0)