]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
*/: s/STRSEP2LS/strsep2ls_a/
authorAlejandro Colomar <alx@kernel.org>
Tue, 14 Oct 2025 11:05:59 +0000 (13:05 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Nov 2025 02:50:48 +0000 (20:50 -0600)
This name better reflects that it handles arrays, and doesn't shout.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/port.c
lib/string/README
lib/string/strtok/strsep2ls.h

index cbb94c3c97b2e214a4111125f15e22adc98ef672..d5338a8ad257b8b11994fa4ddcdf891f2ac8e4c0 100644 (file)
@@ -158,7 +158,7 @@ next:
         * TTY devices.
         */
        port.pt_names = ttys;
-       if (STRSEP2LS(fields[0], ",", ttys) == -1)
+       if (strsep2ls_a(fields[0], ",", ttys) == -1)
                goto next;
 
        /*
@@ -168,7 +168,7 @@ next:
         * The last entry in the list is a NULL pointer.
         */
        port.pt_users = users;
-       if (STRSEP2LS(fields[1], ",", users) == -1)
+       if (strsep2ls_a(fields[1], ",", users) == -1)
                goto next;
 
        /*
index b946c8b3cda59990aabe4d4a60818a97ff421095..431a81d4de1e0f472f50d5384c9663a2b9cc57b7 100644 (file)
@@ -271,7 +271,7 @@ strsep/ - String separation
        Similar to strsep2arr(), but terminate the list with a null
        pointer.
        Useful when the number of delimiter-separated fields is unknown.
-    STRSEP2LS()
+    strsep2ls_a()
        Like strsep2ls(), but take an array.
 
     astrsep2ls()
index f941e2a9cca584e8b60ee22438f8fa6bfe268483..a61e2ef975e6bcadddabc6ad7366d189263f8a18 100644 (file)
@@ -17,7 +17,8 @@
 #include "string/strtok/strsep2arr.h"
 
 
-#define STRSEP2LS(s, delim, ls)  strsep2ls(s, delim, countof(ls), ls)
+// strsep2ls_a - string separate to list-of-strings array
+#define strsep2ls_a(s, delim, ls)  strsep2ls(s, delim, countof(ls), ls)
 
 
 ATTR_ACCESS(read_write, 1) ATTR_ACCESS(write_only, 4, 3)
@@ -26,7 +27,7 @@ inline ssize_t strsep2ls(char *s, const char *restrict delim,
     size_t n, char *ls[restrict n]);
 
 
-// string separate to list-of-strings
+// strsep2ls - string separate to list-of-strings
 // Like strsep2arr(), but add a NULL terminator.
 inline ssize_t
 strsep2ls(char *s, const char *restrict delim, size_t n, char *ls[restrict n])