summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2009-04-03 11:52:08 +0000
committerMagnus Hagander2009-04-03 11:52:08 +0000
commit81d06cf76d60c2d496c2d1b2dcd19b0ac3932922 (patch)
tree9e294d527b8f34d75926067593630f02a9f88578
parent568556b23185bdacebd90b59679f2004c3d44d64 (diff)
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/port/path.c b/src/port/path.c
index 708306d67b..93cffa3c64 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -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++;