[vlc-commits] file: detect long remote paths correctly on Win32

Rémi Denis-Courmont git at videolan.org
Tue Jul 12 19:09:32 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Jul 12 20:08:58 2011 +0300| [3799b698da614d7d56a4aa9d48f1494cfa33043f] | committer: Rémi Denis-Courmont

file: detect long remote paths correctly on Win32

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

 modules/access/file.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/access/file.c b/modules/access/file.c
index 429ce34..5114f38 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -58,6 +58,7 @@
 #   include <io.h>
 #   include <ctype.h>
 #   include <shlwapi.h>
+#   include <vlc_charset.h>
 #elif defined( __OS2__ )
 #   include <ctype.h>
 #else
@@ -175,11 +176,10 @@ int Open( vlc_object_t *p_this )
         }
 
 #ifdef WIN32
-        wchar_t wpath[MAX_PATH+1];
-        if (MultiByteToWideChar (CP_UTF8, 0, path, -1,
-                                 wpath, MAX_PATH)
-         && PathIsNetworkPathW (wpath))
+        wchar_t *wpath = ToWide (path);
+        if (wpath != NULL && PathIsNetworkPathW (wpath))
             is_remote = true;
+        free (wpath);
 # define IsRemote( fd ) ((void)fd, is_remote)
 #endif
     }



More information about the vlc-commits mailing list