Use case-insensitive string match for boolean settings

This commit is contained in:
Marcus Weseloh 2017-12-01 19:29:29 +01:00
parent 9f579d99f3
commit 4b090c2afb
2 changed files with 6 additions and 6 deletions

View file

@ -1363,9 +1363,9 @@ fluid_handle_set(void* data, int ac, char** av, fluid_ostream_t out)
if (fluid_settings_get_hints (handler->synth->settings, av[0], &hints) == FLUID_OK
&& hints & FLUID_HINT_TOGGLED)
{
if (FLUID_STRCMP (av[1], "yes") == 0 || FLUID_STRCMP (av[1], "True") == 0
|| FLUID_STRCMP (av[1], "TRUE") == 0 || FLUID_STRCMP (av[1], "true") == 0
|| FLUID_STRCMP (av[1], "T") == 0)
if (FLUID_STRCASECMP (av[1], "yes") == 0
|| FLUID_STRCASECMP (av[1], "true") == 0
|| FLUID_STRCASECMP (av[1], "t") == 0)
ival = 1;
else ival = atoi (av[1]);
}

View file

@ -94,9 +94,9 @@ void process_o_cmd_line_option(fluid_settings_t* settings, char* optarg)
if (fluid_settings_get_hints (settings, optarg, &hints) == FLUID_OK
&& hints & FLUID_HINT_TOGGLED)
{
if (FLUID_STRCMP (val, "yes") == 0 || FLUID_STRCMP (val, "True") == 0
|| FLUID_STRCMP (val, "TRUE") == 0 || FLUID_STRCMP (val, "true") == 0
|| FLUID_STRCMP (val, "T") == 0)
if (FLUID_STRCASECMP (val, "yes") == 0
|| FLUID_STRCASECMP (val, "true") == 0
|| FLUID_STRCASECMP (val, "t") == 0)
ival = 1;
else ival = atoi (val);
}