fixed windows path determination (patch from Roland Schwarz, bug #462877)

* xmlIO.c: fixed windows path determination (patch from
  Roland Schwarz, bug #462877)
* win32/Makefile.mingw win32/configure.js: fixed mingw build
  (patch from Roland Schwarz, bug #462877)

svn path=/trunk/; revision=3648
diff --git a/ChangeLog b/ChangeLog
index 491d383..da1826f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Aug 14 11:42:27 CEST 2007 Rob Richards <rrichards@ctindustries.net>
+
+	* xmlIO.c: fixed windows path determination (patch from
+	  Roland Schwarz, bug #462877)
+	* win32/Makefile.mingw win32/configure.js: fixed mingw build
+	  (patch from Roland Schwarz, bug #462877)
+
 Wed Aug  1 09:50:12 CEST 2007 Daniel Veillard <daniel@veillard.com>
 
 	* parser.c: fixed a parser bug where invalid char in comment may
diff --git a/win32/Makefile.mingw b/win32/Makefile.mingw
index f41ce6d..e79970e 100644
--- a/win32/Makefile.mingw
+++ b/win32/Makefile.mingw
@@ -237,33 +237,33 @@
 utils : $(UTILS)
 
 clean :
-	cmd.exe /C if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
-	cmd.exe /C if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
-	cmd.exe /C if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
-	cmd.exe /C if exist $(BINDIR) rmdir /S /Q $(BINDIR)
-	cmd.exe /C if exist depends.mingw del depends.mingw
+	cmd.exe /C "if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)"
+	cmd.exe /C "if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)"
+	cmd.exe /C "if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)"
+	cmd.exe /C "if exist $(BINDIR) rmdir /S /Q $(BINDIR)"
+	cmd.exe /C "if exist depends.mingw del depends.mingw"
 
 distclean : clean
-	cmd.exe /C if exist config.* del config.*
-	cmd.exe /C if exist Makefile del Makefile
+	cmd.exe /C "if exist config.* del config.*"
+	cmd.exe /C "if exist Makefile del Makefile"
 
 rebuild : clean all
 
 install-libs : all
-	cmd.exe /C if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml
-	cmd.exe /C if not exist $(BINPREFIX) mkdir $(BINPREFIX)
-	cmd.exe /C if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
-	cmd.exe /C copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml
-	cmd.exe /C copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
-	cmd.exe /C copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
-	cmd.exe /C copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
-	cmd.exe /C copy $(BINDIR)\xml*.exe $(BINPREFIX)
+	cmd.exe /C "if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml"
+	cmd.exe /C "if not exist $(BINPREFIX) mkdir $(BINPREFIX)"
+	cmd.exe /C "if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)"
+	cmd.exe /C "copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml"
+	cmd.exe /C "copy $(BINDIR)\$(XML_SO) $(SOPREFIX)"
+	cmd.exe /C "copy $(BINDIR)\$(XML_A) $(LIBPREFIX)"
+	cmd.exe /C "copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)"
+	cmd.exe /C "copy $(BINDIR)\xml*.exe $(BINPREFIX)"
 
 install : install-libs
-	cmd.exe /C copy $(BINDIR)\*.exe $(BINPREFIX)
+	cmd.exe /C "copy $(BINDIR)\*.exe $(BINPREFIX)"
 
 install-dist : install-libs
-	cmd.exe /C copy $(BINDIR)\xml*.exe $(BINPREFIX)
+	cmd.exe /C "copy $(BINDIR)\xml*.exe $(BINPREFIX)"
 
 # This is a target for me, to make a binary distribution. Not for the public use,
 # keep your hands off :-)
diff --git a/win32/configure.js b/win32/configure.js
index a7cf837..3c960a6 100644
--- a/win32/configure.js
+++ b/win32/configure.js
@@ -565,8 +565,6 @@
 }
 
 dirSep = "\\";
-if (compiler == "mingw")
-	dirSep = "/";
 if (buildBinPrefix == "")
 	buildBinPrefix = "$(PREFIX)" + dirSep + "bin";
 if (buildIncPrefix == "")
diff --git a/xmlIO.c b/xmlIO.c
index 685ce26..7782776 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -3493,7 +3493,6 @@
     char *ret = NULL;
     char dir[1024];
     char *cur;
-    char sep = '/';
 
 #ifdef _WIN32_WCE  /* easy way by now ... wince does not have dirs! */
     return NULL;
@@ -3503,18 +3502,21 @@
 	xmlRegisterDefaultInputCallbacks();
 
     if (filename == NULL) return(NULL);
+
 #if defined(WIN32) && !defined(__CYGWIN__)
-    sep = '\\';
+#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
+#else
+#   define IS_XMLPGD_SEP(ch) (ch=='/')
 #endif
 
     strncpy(dir, filename, 1023);
     dir[1023] = 0;
     cur = &dir[strlen(dir)];
     while (cur > dir) {
-         if (*cur == sep) break;
+         if (IS_XMLPGD_SEP(*cur)) break;
 	 cur --;
     }
-    if (*cur == sep) {
+    if (IS_XMLPGD_SEP(*cur)) {
         if (cur == dir) dir[1] = 0;
 	else *cur = 0;
 	ret = xmlMemStrdup(dir);
@@ -3525,6 +3527,7 @@
 	}
     }
     return(ret);
+#undef IS_XMLPGD_SEP
 }
 
 /****************************************************************