[vlc-devel] commit: dvdnav: Remove trailing backslash on Win32 ( Marian Ďurkovič )

git version control git at videolan.org
Tue Oct 20 10:57:12 CEST 2009


vlc | branch: 1.0-bugfix | Marian Ďurkovič <md at bts.sk> | Mon Oct 19 09:10:41 2009 +0200| [56e75b1fe5a0a6bb45f29f1dcba7e2c960ec414a] | committer: Marian Ďurkovič 

dvdnav: Remove trailing backslash on Win32
(cherry picked from commit 04b1e7b2e5f13519bc04e536d6befe706d95c922)
closes #3110

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

 modules/access/dvdnav.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/access/dvdnav.c b/modules/access/dvdnav.c
index a8512e1..b38852c 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -202,8 +202,11 @@ static int Open( vlc_object_t *p_this )
         psz_name = ToLocaleDup( p_demux->psz_path );
 
 #ifdef WIN32
-    if( psz_name[0] && psz_name[1] == ':' &&
-        psz_name[2] == '\\' && psz_name[3] == '\0' ) psz_name[2] = '\0';
+    /* Remove trailing backslash, otherwise dvdnav_open will fail */
+    if( *psz_name && *(psz_name + strlen(psz_name) - 1) == '\\' )
+    {
+        *(psz_name + strlen(psz_name) - 1) = '\0';
+    }
 #endif
 
     /* Try some simple probing to avoid going through dvdnav_open too often */




More information about the vlc-devel mailing list