diff --git a/opts/control.c b/opts/control.c index 6e5a733..04aa800 100644 --- a/opts/control.c +++ b/opts/control.c @@ -2,28 +2,20 @@ #include #include +#include int device_option_normalize_name(const char *in, char *outp) { // The output is always shorter, so `outp=in` - // colour_correction_matrix => ColourCorrectionMatrix - // Colour Correction Matrix => ColourCorrectionMatrix - // ColourCorrectionMatrix => ColourCorrectionMatrix + // colour_correction_matrix => colourcorrectionmatrix + // Colour Correction Matrix => colourcorrectionmatrix + // ColourCorrectionMatrix => colourcorrectionmatrix char *out = outp; - bool upper = true; while (*in) { if (isalnum(*in)) { - if (upper) { - *out++ = toupper(*in++); - upper = false; - } else { - *out++ = *in++; - } - } else if (isprint(*in)) { - upper = true; - while (*++in && isprint(*in) && !isalnum(*in)); + *out++ = tolower(*in++); } else { in++; }