diff options
-rw-r--r-- | scripts/kconfig/symbol.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index d550300ec00c..020a0ac147e1 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -967,7 +967,7 @@ static int sym_rel_comp( const void *sym1, const void *sym2 ) | |||
967 | { | 967 | { |
968 | struct sym_match *s1 = *(struct sym_match **)sym1; | 968 | struct sym_match *s1 = *(struct sym_match **)sym1; |
969 | struct sym_match *s2 = *(struct sym_match **)sym2; | 969 | struct sym_match *s2 = *(struct sym_match **)sym2; |
970 | int l1, l2; | 970 | int exact1, exact2; |
971 | 971 | ||
972 | /* Exact match: | 972 | /* Exact match: |
973 | * - if matched length on symbol s1 is the length of that symbol, | 973 | * - if matched length on symbol s1 is the length of that symbol, |
@@ -978,11 +978,11 @@ static int sym_rel_comp( const void *sym1, const void *sym2 ) | |||
978 | * exactly; if this is the case, we can't decide which comes first, | 978 | * exactly; if this is the case, we can't decide which comes first, |
979 | * and we fallback to sorting alphabetically. | 979 | * and we fallback to sorting alphabetically. |
980 | */ | 980 | */ |
981 | l1 = s1->eo - s1->so; | 981 | exact1 = (s1->eo - s1->so) == strlen(s1->sym->name); |
982 | l2 = s2->eo - s2->so; | 982 | exact2 = (s2->eo - s2->so) == strlen(s2->sym->name); |
983 | if (l1 == strlen(s1->sym->name) && l2 != strlen(s2->sym->name)) | 983 | if (exact1 && !exact2) |
984 | return -1; | 984 | return -1; |
985 | if (l1 != strlen(s1->sym->name) && l2 == strlen(s2->sym->name)) | 985 | if (!exact1 && exact2) |
986 | return 1; | 986 | return 1; |
987 | 987 | ||
988 | /* As a fallback, sort symbols alphabetically */ | 988 | /* As a fallback, sort symbols alphabetically */ |