mirror of
https://github.com/flatpak/flatpak.git
synced 2026-01-23 23:28:14 -05:00
Avoid suggesting titles
The commands array contains entries that serve just as section titles; avoid returning those when looking for misspelt commands. Pointed out in https://github.com/flatpak/flatpak/issues/3040 Closes: #3107 Approved by: matthiasclasen
This commit is contained in:
committed by
Atomic Bot
parent
5026f01153
commit
d346fa6b7e
@@ -534,10 +534,13 @@ find_similar_command (const char *word,
|
||||
GOptionEntry *entries[3] = { global_entries, empty_entries, user_entries };
|
||||
|
||||
d = G_MAXINT;
|
||||
suggestion = commands[0].name;
|
||||
suggestion = NULL;
|
||||
|
||||
for (i = 0; commands[i].name; i++)
|
||||
{
|
||||
if (!commands[i].fn)
|
||||
continue;
|
||||
|
||||
int d1 = flatpak_levenshtein_distance (word, commands[i].name);
|
||||
if (d1 < d)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user