From: Jarkko Hietaniemi Date: Tue, 27 Mar 2001 19:44:25 +0000 (+0000) Subject: If directory entries compare equal case-insensitively, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd713a85eb6c0ac3df6fa25ed6c5b990a5c3d174;p=p5sagit%2Fp5-mst-13.2.git If directory entries compare equal case-insensitively, retry case-sensitively. p4raw-id: //depot/perl@9385 --- 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