From 6b627aa34d2977eb347b32040c1c3075daad3d1d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 30 Jun 2025 11:15:30 +0200 Subject: [PATCH] lib/strutils: add ul_ prefix to split() function Addresses: https://github.com/util-linux/util-linux/issues/3626 Signed-off-by: Karel Zak --- include/strutils.h | 2 +- lib/strutils.c | 2 +- lib/strv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/strutils.h b/include/strutils.h index 73aba5975..04c867fde 100644 --- a/include/strutils.h +++ b/include/strutils.h @@ -467,7 +467,7 @@ extern int strfappend(char **a, const char *format, ...) extern int ul_strvfappend(char **a, const char *format, va_list ap) __attribute__ ((__format__ (__printf__, 2, 0))); -extern const char *split(const char **state, size_t *l, const char *separator, int quoted); +extern const char *ul_split(const char **state, size_t *l, const char *separator, int quoted); extern char *ul_strchr_escaped(const char *s, int c); diff --git a/lib/strutils.c b/lib/strutils.c index c686feafe..c27d645c2 100644 --- a/lib/strutils.c +++ b/lib/strutils.c @@ -1122,7 +1122,7 @@ char *ul_strchr_escaped(const char *s, int c) } /* Split a string into words. */ -const char *split(const char **state, size_t *l, const char *separator, int quoted) +const char *ul_split(const char **state, size_t *l, const char *separator, int quoted) { const char *current; diff --git a/lib/strv.c b/lib/strv.c index bd006e353..6da638c1a 100644 --- a/lib/strv.c +++ b/lib/strv.c @@ -180,7 +180,7 @@ int ul_strv_extend_strv_concat(char ***a, char **b, const char *suffix) { #define _FOREACH_WORD(word, length, s, separator, quoted, state) \ - for ((state) = (s), (word) = split(&(state), &(length), (separator), (quoted)); (word); (word) = split(&(state), &(length), (separator), (quoted))) + for ((state) = (s), (word) = ul_split(&(state), &(length), (separator), (quoted)); (word); (word) = ul_split(&(state), &(length), (separator), (quoted))) #define FOREACH_WORD_SEPARATOR(word, length, s, separator, state) \ _FOREACH_WORD(word, length, s, separator, false, state) -- 2.47.3