+ for( ; *ppsz_path != NULL ; ppsz_path++ )
+ {
+#ifdef SYS_BEOS
+ /* Under BeOS, we need to add beos_GetProgramPath() to access
+ * files under the current directory */
+ if( strncmp( *ppsz_path, "/", 1 ) )
+ {
+ psz_file = malloc( strlen( psz_name ) + strlen( *ppsz_path )
+ + i_vlclen + 3 );
+ if( psz_file == NULL )
+ {
+ continue;
+ }
+ sprintf( psz_file, "%s/%s/%s", psz_vlcpath, *ppsz_path, psz_name );
+ }
+ else
+#endif
+ {
+ psz_file = malloc( strlen( psz_name ) + strlen( *ppsz_path ) + 2 );
+ if( psz_file == NULL )
+ {
+ continue;
+ }
+ sprintf( psz_file, "%s/%s", *ppsz_path, psz_name );
+ }
+
+ /* Open file */
+ i_file = open( psz_file, O_RDONLY );
+ free( psz_file );
+
+ if( i_file != -1 )
+ {
+ break;
+ }
+ }
+