From: Alejandro Colomar Date: Tue, 14 Oct 2025 11:05:59 +0000 (+0200) Subject: */: s/STRSEP2LS/strsep2ls_a/ X-Git-Tag: 4.19.0-rc1~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2207ea60aa2e77ff616e368431e543fba06e944;p=thirdparty%2Fshadow.git */: s/STRSEP2LS/strsep2ls_a/ This name better reflects that it handles arrays, and doesn't shout. Signed-off-by: Alejandro Colomar --- diff --git a/lib/port.c b/lib/port.c index cbb94c3c9..d5338a8ad 100644 --- a/lib/port.c +++ b/lib/port.c @@ -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; /* diff --git a/lib/string/README b/lib/string/README index b946c8b3c..431a81d4d 100644 --- a/lib/string/README +++ b/lib/string/README @@ -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() diff --git a/lib/string/strtok/strsep2ls.h b/lib/string/strtok/strsep2ls.h index f941e2a9c..a61e2ef97 100644 --- a/lib/string/strtok/strsep2ls.h +++ b/lib/string/strtok/strsep2ls.h @@ -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])