From 58402c9641511e1d773b811272caae3cd8630f91 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 19 Mar 2008 17:33:54 +0100 Subject: [PATCH] Add a_strcasecmp() function Signed-off-by: Julien Danjou --- common/util.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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.