From fd713a85eb6c0ac3df6fa25ed6c5b990a5c3d174 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Tue, 27 Mar 2001 19:44:25 +0000 Subject: [PATCH] If directory entries compare equal case-insensitively, retry case-sensitively. p4raw-id: //depot/perl@9385 --- ext/File/Glob/bsd_glob.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/File/Glob/bsd_glob.c b/ext/File/Glob/bsd_glob.c index 55f8312..a0becd1 100644 --- a/ext/File/Glob/bsd_glob.c +++ b/ext/File/Glob/bsd_glob.c @@ -545,13 +545,17 @@ ci_compare(const void *p, const void *q) { const char *pp = *(const char **)p; const char *qq = *(const char **)q; + int ci; while (*pp && *qq) { if (tolower(*pp) != tolower(*qq)) break; ++pp; ++qq; } - return (tolower(*pp) - tolower(*qq)); + ci = tolower(*pp) - tolower(*qq); + if (ci == 0) + return compare(p, q); + return ci; } static int -- 2.7.4