From: Alejandro Colomar Date: Sat, 8 Feb 2025 10:02:37 +0000 (+0100) Subject: contrib/, lib/: Use strcaseprefix() instead of its pattern X-Git-Tag: 4.18.0-rc1~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0efe2e0e4204378220b6fd7ecd26ac698bf52a86;p=thirdparty%2Fshadow.git contrib/, lib/: Use strcaseprefix() instead of its pattern Signed-off-by: Alejandro Colomar --- diff --git a/contrib/adduser.c b/contrib/adduser.c index bca3883e2..9e162155f 100644 --- a/contrib/adduser.c +++ b/contrib/adduser.c @@ -119,7 +119,7 @@ #include #include "string/strcmp/streq.h" -#include "string/strcmp/strprefix.h" +#include "string/strcmp/strcaseprefix.h" #define IMMEDIATE_CHANGE /* Expire newly created password, must be changed @@ -389,7 +389,7 @@ main (void) fflush (stdout); safeget (foo, sizeof (foo)); - done = bad = correct = (strprefix(foo, "y") || strprefix(foo, "Y")); + done = bad = correct = strcaseprefix(foo, "y"); if (bad != 1) printf ("\nUser [%s] not added\n", usrname); diff --git a/lib/yesno.c b/lib/yesno.c index 27f156bca..b37e41a9f 100644 --- a/lib/yesno.c +++ b/lib/yesno.c @@ -16,7 +16,7 @@ #include #include "prototypes.h" -#include "string/strcmp/strprefix.h" +#include "string/strcmp/strcaseprefix.h" /* @@ -78,9 +78,9 @@ yes_or_no(bool read_only) static int rpmatch(const char *response) { - if (strprefix(response, "y") || strprefix(response, "Y")) + if (strcaseprefix(response, "y")) return 1; - if (strprefix(response, "n") || strprefix(response, "N")) + if (strcaseprefix(response, "n")) return 0; return -1;