summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/strnatcmp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/common/strnatcmp.c b/firmware/common/strnatcmp.c
index 4cc3065..d7ac604 100644
--- a/firmware/common/strnatcmp.c
+++ b/firmware/common/strnatcmp.c
@@ -130,9 +130,12 @@ static int strnatcmp0(char const *a, char const *b, int fold_case)
}
if (!ca && !cb) {
- /* The strings compare the same. Perhaps the caller
- will want to call strcmp to break the tie. */
- return 0;
+ /* The strings compare the same. Call str[case]cmp() to ensure
+ consistent results. */
+ if(fold_case)
+ return strcasecmp(a,b);
+ else
+ return strcmp(a,b);
}
if (fold_case) {