Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/string_utils.c')
-rw-r--r--source/blender/blenlib/intern/string_utils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/string_utils.c b/source/blender/blenlib/intern/string_utils.c
index b956e1c0a7e..85cb32b6457 100644
--- a/source/blender/blenlib/intern/string_utils.c
+++ b/source/blender/blenlib/intern/string_utils.c
@@ -410,12 +410,30 @@ bool BLI_uniquename(
/** \name Join Strings
*
* For non array versions of these functions, use the macros:
+ * - #BLI_string_join
* - #BLI_string_joinN
* - #BLI_string_join_by_sep_charN
* - #BLI_string_join_by_sep_char_with_tableN
*
* \{ */
+char *BLI_string_join_array(char *result,
+ size_t result_len,
+ const char *strings[],
+ uint strings_len)
+{
+ char *c = result;
+ char *c_end = &result[result_len - 1];
+ for (uint i = 0; i < strings_len; i++) {
+ const char *p = strings[i];
+ while (*p && (c < c_end)) {
+ *c++ = *p++;
+ }
+ }
+ *c = '\0';
+ return c;
+}
+
/**
* Join an array of strings into a newly allocated, null terminated string.
*/