]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/: stris*(): Rename C-locale APIs with a _c suffix
authorAlejandro Colomar <alx@kernel.org>
Fri, 2 Jan 2026 20:46:31 +0000 (21:46 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Thu, 11 Jun 2026 07:33:53 +0000 (09:33 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/chkname.c
lib/fields.c
lib/string/ctype/strchrisascii.c
lib/string/ctype/strchrisascii.h
lib/string/ctype/strisascii.c
lib/string/ctype/strisascii.h
lib/subordinateio.c

index ad5d70db09cae66a388d012ccbffe8dcc45d8ab5..85735d9c53d09686bddbaeaeb7ef33ab0983a3dd 100644 (file)
@@ -51,8 +51,8 @@ is_valid_name(const char *name)
         || streq(name, "..")
         || strspn(name, "-")
         || strpbrk(name, " \"#',/:;")
-        || strchriscntrl(name)
-        || strisdigit(name))
+        || strchriscntrl_c(name)
+        || strisdigit_c(name))
        {
                errno = EINVAL;
                return false;
index 77eb8c2d4f5fc08609c1bc40f9f88cb4417574bb..af9bed077e4391a884297319235586a9edcf7cc9 100644 (file)
@@ -43,9 +43,9 @@ valid_field_(const char *field, const char *illegal)
 
        if (strpbrk(field, illegal))
                return -1;
-       if (strchriscntrl(field))
+       if (strchriscntrl_c(field))
                return -1;
-       if (strisprint(field))
+       if (strisprint_c(field))
                return 0;
        if (streq(field, ""))
                return 0;
index b9b7e919a9fda1db5cc8000eef54cf294014312b..5e25b23fa920c8b09090beec5d058c7133d0ca90 100644 (file)
@@ -9,4 +9,4 @@
 #include <stdbool.h>
 
 
-extern inline bool strchriscntrl(const char *s);
+extern inline bool strchriscntrl_c(const char *s);
index a2be4e321a81c54eb78a783f9220923e37fc1dc2..04da16e9d361a087f3ae012a6ef26b113bab1be6 100644 (file)
 #include "string/strcmp/streq.h"
 
 
-inline bool strchriscntrl(const char *s);
+inline bool strchriscntrl_c(const char *s);
 
 
-// strchriscntrl - string character is [:cntrl:]
+// strchriscntrl_c - string character is [:cntrl:] C-locale
 inline bool
-strchriscntrl(const char *s)
+strchriscntrl_c(const char *s)
 {
        for (; !streq(s, ""); s++) {
                unsigned char  c = *s;
index 564dac25043fadb28e5c9b95e1f054d628688b95..c87c8f1b28bf6bb521248cdbbbd9f34d50e10c75 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2024-2025, Alejandro Colomar <alx@kernel.org>
 // SPDX-License-Identifier: BSD-3-Clause
 
 
@@ -9,5 +9,5 @@
 #include <stdbool.h>
 
 
-extern inline bool strisdigit(const char *s);
-extern inline bool strisprint(const char *s);
+extern inline bool strisdigit_c(const char *s);
+extern inline bool strisprint_c(const char *s);
index 2f58f43ea59ab057c6dbff09b804101c0aed7b7d..8e6b59b0bd23569f7cdfc7942a57ed1a414ea48d 100644 (file)
 #include "string/strspn/stpspn.h"
 
 
-inline bool strisdigit(const char *s); // strisdigit - string is [:digit:]
-inline bool strisprint(const char *s); // strisprint - string is [:print:]
+inline bool strisdigit_c(const char *s); // strisdigit - string is [:digit:] C-locale
+inline bool strisprint_c(const char *s); // strisprint - string is [:print:] C-locale
 
 
 inline bool
-strisdigit(const char *s)
+strisdigit_c(const char *s)
 {
        return !streq(s, "") && streq(stpspn(s, CTYPE_DIGIT_C), "");
 }
 inline bool
-strisprint(const char *s)
+strisprint_c(const char *s)
 {
        return !streq(s, "") && streq(stpspn(s, CTYPE_PRINT_C), "");
 }
index 7f6db7e421c0633c8dfc4d290102dd06732851e8..dacfe2015bf7f28235e29f1082517e8a145f5ad1 100644 (file)
@@ -907,7 +907,7 @@ static int append_uids(uid_t **uids, const char *owner, int n)
        int    i;
        uid_t  owner_uid;
 
-       if (strisdigit(owner)) {
+       if (strisdigit_c(owner)) {
                i = sscanf(owner, "%d", &owner_uid);
                if (i != 1) {
                        // should not happen