From 4b090c2afba49cce3c9ec00520717442f945ddb3 Mon Sep 17 00:00:00 2001 From: Marcus Weseloh Date: Fri, 1 Dec 2017 19:29:29 +0100 Subject: [PATCH] Use case-insensitive string match for boolean settings --- src/bindings/fluid_cmd.c | 6 +++--- src/fluidsynth.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bindings/fluid_cmd.c b/src/bindings/fluid_cmd.c index 4e79f66b..4aa4caa8 100644 --- a/src/bindings/fluid_cmd.c +++ b/src/bindings/fluid_cmd.c @@ -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]); } diff --git a/src/fluidsynth.c b/src/fluidsynth.c index bfb80af5..11d08fde 100644 --- a/src/fluidsynth.c +++ b/src/fluidsynth.c @@ -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); }