Fix [21233]
authorChristophe Mutricy <xtophe@videolan.org>
Sun, 19 Aug 2007 15:05:30 +0000 (15:05 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Sun, 19 Aug 2007 15:05:30 +0000 (15:05 +0000)
modules/meta_engine/luameta.c

index 22f5078..c6fb311 100644 (file)
@@ -328,12 +328,16 @@ static int vlclua_scripts_batch_execute( vlc_object_t *p_this,
         if( ( utf8_stat( "share/luaplaylist", &stat_info ) == -1 )
             || !S_ISDIR( stat_info.st_mode ) )
         {
-            ppsz_dir_list[1] = strdup( DATA_PATH "/luaplaylist" );
+            if( asprintf( &ppsz_dir_list[1], 
+                          DATA_PATH DIR_SEP "%s", luadirname ) < 0 )
+                return VLC_ENOMEM;
         }
         else
 #   endif
         {
-            ppsz_dir_list[1] = strdup( "share/luaplaylist" );
+            if( asprintf( &ppsz_dir_list[1], 
+                          "share" DIR_SEP "%s", luadirname ) < 0 )
+                return VLC_ENOMEM;
         }
     }
 #   endif