]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/strutils: add ul_ prefix to split() function
authorKarel Zak <kzak@redhat.com>
Mon, 30 Jun 2025 09:15:30 +0000 (11:15 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Jun 2025 09:22:45 +0000 (11:22 +0200)
Addresses: https://github.com/util-linux/util-linux/issues/3626
Signed-off-by: Karel Zak <kzak@redhat.com>
include/strutils.h
lib/strutils.c
lib/strv.c

index 73aba597501f8b4c9aab410b79d03c7003d11c96..04c867fde889adeba4b5752d8c68d14ae559b9a7 100644 (file)
@@ -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);
 
index c686feafe02db6063390d2868b66e7b6cec6d085..c27d645c21b8200914e5f22a105fa876af97aa0c 100644 (file)
@@ -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;
 
index bd006e353a8103a76bdf137980caf10a3a63722c..6da638c1a26d655b5db83e50f88fb61f66d38855 100644 (file)
@@ -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)