aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2009-04-03 11:52:10 +0000
committerMagnus Hagander <magnus@hagander.net>2009-04-03 11:52:10 +0000
commit4e440e97b1b3d757be385e50adbf6a5381a25445 (patch)
tree02a5ce2d95b8ce4f650e34839a278caadc1490bf
parentda5bfbd970fd40b89586991e9227df8e93f744b3 (diff)
downloadpostgresql-4e440e97b1b3d757be385e50adbf6a5381a25445.tar.gz
postgresql-4e440e97b1b3d757be385e50adbf6a5381a25445.zip
Make directory name comparisons on Win32 case insensitive.
This method will not catch all different ways since the locale handling in NTFS doesn't provide an easy way to do that, but it will hopefully solve the most common cases causing startup problems when the backend is found in the system PATH. Attempts to fix bug #4694.
-rw-r--r--src/port/path.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/port/path.c b/src/port/path.c
index 28608e979cf..13b57c81c1d 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/path.c,v 1.70 2006/10/04 00:30:14 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.70.2.1 2009/04/03 11:52:10 mha Exp $
*
*-------------------------------------------------------------------------
*/
@@ -427,7 +427,12 @@ dir_strcmp(const char *s1, const char *s2)
{
while (*s1 && *s2)
{
+#ifndef WIN32
if (*s1 != *s2 &&
+#else
+ /* On windows, paths are case-insensitive */
+ if (pg_tolower(*s1) != pg_tolower(*s2) &&
+#endif
!(IS_DIR_SEP(*s1) && IS_DIR_SEP(*s2)))
return (int) *s1 - (int) *s2;
s1++, s2++;