summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2009-04-03 23:27:17 +0000
committerTom Lane2009-04-03 23:27:17 +0000
commit3671c87e57870ea2fc60a1c9f1b3e916cdada7e1 (patch)
tree4eaaaca2cd549175baaf401b866d5b819ce36151
parent07f3168b761d44b71b66166cd0ea740508faa5ea (diff)
Use (unsigned char) cast in argument of pg_tolower(). Maybe it works on
Windows without that, but we shouldn't put bad examples where people might copy them. Also, reformat slightly to improve the odds that pgindent won't go nuts on this.
-rw-r--r--src/port/path.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/port/path.c b/src/port/path.c
index 93cffa3c64..a841ef4f95 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -420,20 +420,22 @@ get_progname(const char *argv0)
/*
- * dir_strcmp: strcmp except any two DIR_SEP characters are considered equal
+ * dir_strcmp: strcmp except any two DIR_SEP characters are considered equal,
+ * and we honor filesystem case insensitivity if known
*/
static int
dir_strcmp(const char *s1, const char *s2)
{
while (*s1 && *s2)
{
+ if (
#ifndef WIN32
- if (*s1 != *s2 &&
+ *s1 != *s2
#else
/* On windows, paths are case-insensitive */
- if (pg_tolower(*s1) != pg_tolower(*s2) &&
+ pg_tolower((unsigned char) *s1) != pg_tolower((unsigned char) *s2)
#endif
- !(IS_DIR_SEP(*s1) && IS_DIR_SEP(*s2)))
+ && !(IS_DIR_SEP(*s1) && IS_DIR_SEP(*s2)))
return (int) *s1 - (int) *s2;
s1++, s2++;
}