With respect to this patch, the only nitpick I have is that we should add a comment for the new functions, even if it is something as basic as "case insensitive version of _cdio_strcmp / _cdio_strncmp" respectively. I don't mind adding that as a commit after the patch in a git branch and others can comment how well I do at getting the comment right.
Do I have it correct that this patch has no comments/controversy aside from the small one I raised? Overall, I'd like to get those patches without any controversy into the code soon. I am not 100% certain which ones have disputes in them. Is it just Patch 2? As for the cut and paste holdover typo in patch 2, sure I have no problem in trying to fix, and again others can double check whether I got this correct. As for the ones that are where there is some disagreement, I'd like to narrow things down as much as possible. If I have it correct, there were certain issues where there could be more done, but Pete does not feel a need to do that, or what he calls the 1% situation. A suggestion is to start with what Pete has since this is an improvement and addresses a real need. Then if Thomas you have the inclination and time to make more perfect, that can be done as a follow on. As I understand it though, the main disagreement is about what the default behavior should be. I don't see it that bad to start out one way and if that becomes onerous switch to the other way though. Thoughts and guidance here? On Wed, Jan 24, 2024 at 12:44 PM Pete Batard <pbat...@gmail.com> wrote: > --- > include/cdio/util.h | 6 ++++++ > lib/driver/libcdio.sym | 2 ++ > lib/driver/util.c | 29 +++++++++++++++++++++++++++++ > 3 files changed, 37 insertions(+) > > diff --git a/include/cdio/util.h b/include/cdio/util.h > index 9cca8f9f..82a22bbf 100644 > --- a/include/cdio/util.h > +++ b/include/cdio/util.h > @@ -105,6 +105,12 @@ _cdio_memdup (const void *mem, size_t count); > char * > _cdio_strdup_upper (const char str[]); > > +int > +_cdio_stricmp(const char str1[], const char str2[]); > + > +int > +_cdio_strnicmp(const char str1[], const char str2[], size_t count); > + > /*! Duplicate path and make it platform compliant. Typically needed for > MinGW/MSYS where a "/c/..." path must be translated to "c:/..." for > use with fopen(), etc. Returned string must be freed by the caller > diff --git a/lib/driver/libcdio.sym b/lib/driver/libcdio.sym > index 7d757af9..b20031b7 100644 > --- a/lib/driver/libcdio.sym > +++ b/lib/driver/libcdio.sym > @@ -12,6 +12,8 @@ _cdio_list_node_free > _cdio_list_node_next > _cdio_list_prepend > _cdio_strfreev > +_cdio_stricmp > +_cdio_strnicmp > _cdio_strsplit > cdio_abspath > cdio_audio_get_msf_seconds > diff --git a/lib/driver/util.c b/lib/driver/util.c > index 5108457e..9fede555 100644 > --- a/lib/driver/util.c > +++ b/lib/driver/util.c > @@ -140,6 +140,35 @@ _cdio_strdup_upper (const char str[]) > return new_str; > } > > +int > +_cdio_stricmp (const char str1[], const char str2[]) > +{ > + if (str1 && str2) { > + int c1, c2; > + do { > + c1 = tolower((unsigned char)*str1++); > + c2 = tolower((unsigned char)*str2++); > + } while (c1 == c2 && c1 != '\0'); > + return c1 - c2; > + } else return (str1 != str2); > +} > + > +int > +_cdio_strnicmp(const char str1[], const char str2[], size_t count) > +{ > + if (str1 && str2) { > + int c1 = 0, c2 = 0; > + size_t i; > + for (i = 0; i < count; i++) { > + c1 = tolower((unsigned char)*str1++); > + c2 = tolower((unsigned char)*str2++); > + if (c1 != c2 || c1 == '\0') > + break; > + } > + return c1 - c2; > + } else return (str1 != str2); > +} > + > /* Convert MinGW/MSYS paths that start in "/c/..." to "c:/..." > so that they can be used with fopen(), stat(), etc. > Returned string must be freed by the caller using cdio_free().*/ > -- > 2.43.0.windows.1 > > >