diff --git a/common/util.h b/common/util.h index eeb5a4d08..ac621eb26 100644 --- a/common/util.h +++ b/common/util.h @@ -177,6 +177,17 @@ static inline int a_strcmp(const char *a, const char *b) return strcmp(NONULL(a), NONULL(b)); } +/** \brief \c NULL resistant strcasecmp. + * \param[in] a the first string. + * \param[in] b the second string. + * \return strcasecmp(a, b), and treats \c NULL strings like \c "" + * ones. + */ +static inline int a_strcasecmp(const char *a, const char *b) +{ + return strcasecmp(NONULL(a), NONULL(b)); +} + /** \brief \c NULL resistant strncmp. * \param[in] a the first string. * \param[in] b the second string.