svn commit: r1932154 - in subversion/trunk/subversion: include libsvn_subr

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177263074141.3786836.8284489307746556689@svn02-us-east.apache.org>
Author: rinrab
Date: Wed Mar  4 13:25:40 2026
New Revision: 1932154

Log:
Return an array of 'char*' from svn_cstring_split()/svn_cstring_split_append()
instead of 'const char*'. There is some existing code that already treats it
like that.

Further reasoning and discussion can be found on the mailing list [1].

* subversion/include/svn_string.h
  (svn_cstring_split): Update description of return value type in docstring.
* subversion/libsvn_subr/string.c
  (svn_cstring_split_append): Use 'char*' instead of 'const char*' when
   pushing a new array element. 

Reviewed by: brane

[1] https://lists.apache.org/thread/jpd1wm9nqcwkb5cc5q429txxhb1n63kx

Modified:
   subversion/trunk/subversion/include/svn_string.h
   subversion/trunk/subversion/libsvn_subr/string.c

Modified: subversion/trunk/subversion/include/svn_string.h
==============================================================================
--- subversion/trunk/subversion/include/svn_string.h	Wed Mar  4 13:23:42 2026	(r1932153)
+++ subversion/trunk/subversion/include/svn_string.h	Wed Mar  4 13:25:40 2026	(r1932154)
@@ -463,8 +463,8 @@ svn_string_compare_stringbuf(const svn_s
 /** Divide @a input into substrings, interpreting any char from @a sep
  * as a token separator.
  *
- * Return an array of copies of those substrings (plain const char*),
- * allocating both the array and the copies in @a pool.
+ * Return an array of copies of those substrings (plain char*), allocating
+ * both the array and the copies in @a pool.
  *
  * None of the elements added to the array contain any of the
  * characters in @a sep_chars, and none of the new elements are empty

Modified: subversion/trunk/subversion/libsvn_subr/string.c
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/string.c	Wed Mar  4 13:23:42 2026	(r1932153)
+++ subversion/trunk/subversion/libsvn_subr/string.c	Wed Mar  4 13:25:40 2026	(r1932154)
@@ -902,7 +902,7 @@ svn_cstring_split_append(apr_array_heade
         }
 
       if (p[0] != '\0')
-        APR_ARRAY_PUSH(array, const char *) = p;
+        APR_ARRAY_PUSH(array, char *) = p;
 
       p = svn_cstring_tokenize(sep_chars, &pats);
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.