1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Recomment do_tab_compl_unambiguous.

This commit is contained in:
Miciah Dashiel Butler Masters 2005-12-17 00:02:15 +00:00 committed by Miciah Dashiel Butler Masters
parent 093800d6fb
commit fa0ce83f24

View File

@ -119,13 +119,20 @@ do_tab_compl_unambiguous(struct dialog_data *dlg_data, struct list_head *history
int cur_len = strcommonlen(cur, match ? match int cur_len = strcommonlen(cur, match ? match
: widget_data->cdata); : widget_data->cdata);
/* Throw away it away if it isn't even as long as what the user
* entered. */
if (cur_len < base_len) if (cur_len < base_len)
continue; continue;
if (!match) { if (!match) {
/* This is the first match, so its length is the maximum
* for any future matches. */
longest_common_match = strlen(entry->data); longest_common_match = strlen(entry->data);
match = entry->data; match = entry->data;
} else if (cur_len < longest_common_match) { } else if (cur_len < longest_common_match) {
/* The current match has a shorter substring in common
* with the previous candidates, so the common substring
* shrinks. */
longest_common_match = cur_len; longest_common_match = cur_len;
} }
} }