Oops. Fix regression in instrument loader resulting in a confusing error message.

This commit is contained in:
Jonathan Moore Liles 2008-02-22 18:37:46 -06:00
parent 7421e646df
commit bbd49089a1
1 changed files with 21 additions and 12 deletions

View File

@ -51,7 +51,7 @@ using std::string;
loading instruments, user defined instruments always hide system loading instruments, user defined instruments always hide system
defined instruments of the same name. defined instruments of the same name.
*/ */
list <Instrument *> Instrument::instruments; list <Instrument *> Instrument::instruments;
@ -290,11 +290,20 @@ Instrument::listing ( void )
list <string> *sys = get_listing( SYSTEM_PATH INSTRUMENT_DIR ); list <string> *sys = get_listing( SYSTEM_PATH INSTRUMENT_DIR );
list <string> *usr = get_listing( config.user_config_dir ); list <string> *usr = get_listing( config.user_config_dir );
if ( ! ( usr || sys ) )
return NULL;
if ( sys && usr )
usr->merge( *sys ); usr->merge( *sys );
else
if ( sys && ! usr )
usr = sys;
usr->unique(); usr->unique();
usr->sort(); usr->sort();
if ( sys )
delete sys; delete sys;
char **sa = (char**)malloc( (usr->size() + 1) * sizeof( char * ) ); char **sa = (char**)malloc( (usr->size() + 1) * sizeof( char * ) );