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

pull/3/head
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
defined instruments of the same name.
*/
*/
list <Instrument *> Instrument::instruments;
@ -290,11 +290,20 @@ Instrument::listing ( void )
list <string> *sys = get_listing( SYSTEM_PATH INSTRUMENT_DIR );
list <string> *usr = get_listing( config.user_config_dir );
if ( ! ( usr || sys ) )
return NULL;
if ( sys && usr )
usr->merge( *sys );
else
if ( sys && ! usr )
usr = sys;
usr->unique();
usr->sort();
if ( sys )
delete sys;
char **sa = (char**)malloc( (usr->size() + 1) * sizeof( char * ) );