[vlc-devel] commit: Fix parsing of plugin-path with escaping chars... ( Jérôme Decoodt )
git version control
git at videolan.org
Mon Apr 14 18:33:50 CEST 2008
vlc | branch: master | Jérôme Decoodt <djc+git at videolan.org> | Mon Apr 14 18:32:53 2008 +0200| [0a7905f66c05cd0ae4c34cf2c1a27371213dc110]
Fix parsing of plugin-path with escaping chars...
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0a7905f66c05cd0ae4c34cf2c1a27371213dc110
---
src/modules/modules.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 82fa25b..cc76506 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -863,7 +863,7 @@ void module_PutConfig( module_config_t *config )
static char * copy_next_paths_token( char * paths, char ** remaining_paths )
{
char * path;
- int i;
+ int i, done;
bool escaped = false;
assert( paths );
@@ -873,20 +873,20 @@ static char * copy_next_paths_token( char * paths, char ** remaining_paths )
if( !path ) return NULL;
/* Look for PATH_SEP_CHAR (a ':' or a ';') */
- for( i = 0; paths[i]; i++ ) {
+ for( i = 0, done = 0 ; paths[i]; i++ ) {
/* Take care of \\ and \: or \; escapement */
if( escaped ) {
escaped = false;
- path[i] = paths[i];
+ path[done++] = paths[i];
}
else if( paths[i] == '\\' )
escaped = true;
else if( paths[i] == PATH_SEP_CHAR )
break;
else
- path[i] = paths[i];
+ path[done++] = paths[i];
}
- path[i] = 0;
+ path[done++] = 0;
/* Return the remaining paths */
if( remaining_paths ) {
More information about the vlc-devel
mailing list