[vlc-devel] commit: dvdnav: Remove trailing backslash on Win32 ( Marian Ďurkovič )
git version control
git at videolan.org
Mon Oct 19 09:11:14 CEST 2009
vlc | branch: master | Marian Ďurkovič <md at bts.sk> | Mon Oct 19 09:10:41 2009 +0200| [04b1e7b2e5f13519bc04e536d6befe706d95c922] | committer: Marian Ďurkovič
dvdnav: Remove trailing backslash on Win32
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04b1e7b2e5f13519bc04e536d6befe706d95c922
---
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 a7b610e..54e3c68 100644
--- a/modules/access/dvdnav.c
+++ b/modules/access/dvdnav.c
@@ -199,8 +199,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