aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-04-03 23:27:22 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-04-03 23:27:22 +0000
commitf7730d0e1111988bdbc3f4507bbdd0f46fc07788 (patch)
tree9419e716e2fe0b9c594940c55ae965020af3c26a
parent0e28fc4c92a8ac0ade9390e8de2dcd8eda2861f6 (diff)
downloadpostgresql-f7730d0e1111988bdbc3f4507bbdd0f46fc07788.tar.gz
postgresql-f7730d0e1111988bdbc3f4507bbdd0f46fc07788.zip
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.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/port/path.c b/src/port/path.c
index c95cc7dcc53..4f1d1d6b401 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/path.c,v 1.74.2.1 2009/04/03 11:52:12 mha Exp $
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.74.2.2 2009/04/03 23:27:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -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++;
}