]> git.sesse.net Git - vlc/commitdiff
Constify
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 1 Oct 2009 18:41:52 +0000 (21:41 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 1 Oct 2009 18:41:52 +0000 (21:41 +0300)
modules/demux/playlist/playlist.c
modules/demux/playlist/playlist.h

index 8e104c074473bf08ffc19b7eb8ec425752b54996..6799451a7c2c31c8b88d42683b742ec62841258a 100644 (file)
@@ -202,7 +202,7 @@ char *FindPrefix( demux_t *p_demux )
  * Add the directory part of the playlist file to the start of the
  * mrl, if the mrl is a relative file path
  */
-char *ProcessMRL( char *psz_mrl, char *psz_prefix )
+char *ProcessMRL( const char *psz_mrl, const char *psz_prefix )
 {
     /* Check for a protocol name.
      * for URL, we should look for "://"
@@ -222,8 +222,8 @@ char *ProcessMRL( char *psz_mrl, char *psz_prefix )
     if( strchr( psz_mrl, ':' ) ) return strdup( psz_mrl );
 
     /* This a relative path, prepend the prefix */
-    if( asprintf( &psz_mrl, "%s%s", psz_prefix, psz_mrl ) != -1 )
-        return psz_mrl;
-    else
-        return NULL;
+    char *ret;
+    if( asprintf( &ret, "%s%s", psz_prefix, psz_mrl ) == -1 )
+        ret = NULL;
+    return ret;
 }
index 8b74778ac60b77b6187776146ac4ad53470ba622..3c3c80719dd54534fa42e2ce15e26248fa3e08bb 100644 (file)
@@ -24,7 +24,7 @@
 #include <vlc_input.h>
 #include <vlc_playlist.h>
 
-char *ProcessMRL( char *, char * );
+char *ProcessMRL( const char *, const char * );
 char *FindPrefix( demux_t * );
 
 int Import_Old ( vlc_object_t * );