[vlc-commits] contrib: xml: Don't use getcwd on winrt

Hugo Beauzée-Luyssen git at videolan.org
Tue May 3 11:47:09 CEST 2016


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue May  3 11:43:24 2016 +0200| [5e19f9d8dacccb5be1eddbf1ff3f40b35d0f5186] | committer: Hugo Beauzée-Luyssen

contrib: xml: Don't use getcwd on winrt

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5e19f9d8dacccb5be1eddbf1ff3f40b35d0f5186
---

 contrib/src/libxml2/nogetcwd.patch |   47 ++++++++++++++++++++++++++++++++++++
 contrib/src/libxml2/rules.mak      |    3 +++
 2 files changed, 50 insertions(+)

diff --git a/contrib/src/libxml2/nogetcwd.patch b/contrib/src/libxml2/nogetcwd.patch
new file mode 100644
index 0000000..cef4efe
--- /dev/null
+++ b/contrib/src/libxml2/nogetcwd.patch
@@ -0,0 +1,47 @@
+--- libxml2/xmlIO.c.orig	2016-05-03 11:27:32.110248362 +0200
++++ libxml2/xmlIO.c	2016-05-03 11:27:55.310675774 +0200
+@@ -3810,44 +3810,7 @@
+  */
+ char *
+ xmlParserGetDirectory(const char *filename) {
+-    char *ret = NULL;
+-    char dir[1024];
+-    char *cur;
+-
+-#ifdef _WIN32_WCE  /* easy way by now ... wince does not have dirs! */
+     return NULL;
+-#endif
+-
+-    if (xmlInputCallbackInitialized == 0)
+-	xmlRegisterDefaultInputCallbacks();
+-
+-    if (filename == NULL) return(NULL);
+-
+-#if defined(WIN32) && !defined(__CYGWIN__)
+-#   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 (IS_XMLPGD_SEP(*cur)) break;
+-	 cur --;
+-    }
+-    if (IS_XMLPGD_SEP(*cur)) {
+-        if (cur == dir) dir[1] = 0;
+-	else *cur = 0;
+-	ret = xmlMemStrdup(dir);
+-    } else {
+-        if (getcwd(dir, 1024) != NULL) {
+-	    dir[1023] = 0;
+-	    ret = xmlMemStrdup(dir);
+-	}
+-    }
+-    return(ret);
+-#undef IS_XMLPGD_SEP
+ }
+ 
+ /****************************************************************
diff --git a/contrib/src/libxml2/rules.mak b/contrib/src/libxml2/rules.mak
index 498f81e..a311100 100644
--- a/contrib/src/libxml2/rules.mak
+++ b/contrib/src/libxml2/rules.mak
@@ -38,6 +38,9 @@ libxml2: libxml2-$(LIBXML2_VERSION).tar.gz .sum-libxml2
 	$(APPLY) $(SRC)/libxml2/win32.patch
 	$(APPLY) $(SRC)/libxml2/bins.patch
 	$(APPLY) $(SRC)/libxml2/pthread.patch
+ifdef HAVE_WINRT
+	$(APPLY) $(SRC)/libxml2/nogetcwd.patch
+endif
 	$(MOVE)
 
 .libxml2: libxml2



More information about the vlc-commits mailing list