}
if (strcmp(hist_entry, cmdline) == 0) {
same_entry:
+ if (idx == READLINE_MAX_CMDS - 1) {
+ return;
+ }
new_entry = hist_entry;
/* Put this entry at the end of history */
memmove(&rs->history[idx], &rs->history[idx + 1],
}
}
+void readline_add_completion_of(ReadLineState *rs,
+ const char *pfx, const char *str)
+{
+ if (!strncmp(str, pfx, strlen(pfx))) {
+ readline_add_completion(rs, str);
+ }
+}
+
void readline_set_completion_index(ReadLineState *rs, int index)
{
rs->completion_index = index;