- vlc_array_append( arraypaths, strdup( "modules" ) );
-#if defined( WIN32 ) || defined( UNDER_CE ) || defined( __APPLE__ ) || defined( SYS_BEOS )
- if( asprintf( &path, "%s" DIR_SEP "modules",
- vlc_global()->psz_vlcpath ) < 0 )
- RETURN_ENOMEM
- vlc_array_append( arraypaths, path );
- if( asprintf( &path, "%s" DIR_SEP "plugins",
- vlc_global()->psz_vlcpath ) < 0 )
- RETURN_ENOMEM
- vlc_array_append( arraypaths, path );
-#if ! defined( WIN32 ) && ! defined( UNDER_CE )
- if( asprintf( &path, "%s", PLUGIN_PATH ) < 0 )
- RETURN_ENOMEM
- vlc_array_append( arraypaths, path );
-#endif
-#else
+ if( vlcpath && asprintf( &path, "%s" DIR_SEP "modules", vlcpath ) != -1 )
+ vlc_array_append( arraypaths, path );
+ if( vlcpath && asprintf( &path, "%s" DIR_SEP "plugins", vlcpath ) != -1 )
+ vlc_array_append( arraypaths, path );
+#ifndef WIN32