Path case sensitivity on windows

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Path case sensitivity on windows
Дата
Msg-id 49D4B88D.4000300@hagander.net
обсуждение исходный текст
Ответы Re: Path case sensitivity on windows  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Bug #4694
(http://archives.postgresql.org/message-id/200903050848.n258mVgm046178@wwwmaster.postgresql.org)
shows a very strange behaviour on windows when you use a different case PATH

>From what I can tell, this is because dir_strcmp() is case sensitive,
but paths on windows are really case-insensitive.

Attached patch fixes this in my testcase. Can anybody spot something
wrong with it? If not, I'll apply once I've finished my test runs:-)

//Magnus
diff --git a/src/port/path.c b/src/port/path.c
index 708306d..d7bd353 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 (tolower(*s1) != tolower(*s2) &&
+#endif
             !(IS_DIR_SEP(*s1) && IS_DIR_SEP(*s2)))
             return (int) *s1 - (int) *s2;
         s1++, s2++;

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Bug of ALTER TABLE DROP CONSTRAINT
Следующее
От: Nikhil Sontakke
Дата:
Сообщение: Re: Bug of ALTER TABLE DROP CONSTRAINT