SMF: fix breakage when instrument names contain spaces.
This commit is contained in:
parent
047a003df1
commit
4f186d9acb
12
smf.C
12
smf.C
|
@ -805,24 +805,28 @@ smf::read_pattern_info ( pattern *p )
|
|||
name_set = true;
|
||||
break;
|
||||
case smf::INSTRUMENT:
|
||||
// FIXME: decode mapping;
|
||||
{
|
||||
char *s = read_text();
|
||||
|
||||
|
||||
char pat[256];
|
||||
|
||||
if ( 1 == sscanf( s, "Instrument: %s", pat ) )
|
||||
if ( 1 == sscanf( s, "Instrument: %[^\n]", pat ) )
|
||||
{
|
||||
if ( ! p->mapping.open( Mapping::INSTRUMENT, pat ) )
|
||||
{
|
||||
p->mapping.open( Mapping::SCALE, "Chromatic" );
|
||||
WARNING( "could not find instrument \"%s\"", pat );
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( 1 == sscanf( s, "Scale: %s", pat ) )
|
||||
if ( 1 == sscanf( s, "Scale: %[^\n]", pat ) )
|
||||
{
|
||||
if ( ! p->mapping.open( Mapping::SCALE, pat ) )
|
||||
{
|
||||
p->mapping.open( Mapping::SCALE, "Chromatic" );
|
||||
WARNING( "could not find scale \"%s\"", pat );
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case smf::PORT:
|
||||
|
|
Loading…
Reference in New Issue