From 63a71348f232930a18e6341ba1adc8832059f5d5 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Fri, 16 Dec 2005 23:48:41 +0000 Subject: [PATCH] Refactor. --- src/bfu/inphist.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bfu/inphist.c b/src/bfu/inphist.c index ab7fe692b..43f406b7c 100644 --- a/src/bfu/inphist.c +++ b/src/bfu/inphist.c @@ -124,13 +124,12 @@ do_tab_compl_unambiguous(struct dialog_data *dlg_data, struct list_head *history if (!match) { cur_len = strlen(entry->data); - } else if (cur_len >= longest_common_match) { - continue; + longest_common_match = cur_len; + match = entry->data; + } else if (cur_len < longest_common_match) { + longest_common_match = cur_len; + match = entry->data; } - - /* We found the next shortest common match. */ - longest_common_match = cur_len; - match = entry->data; } if (!match) return;