From a2438132a675be4dde3acbdf03ba1fdb2f09427c Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Sat, 10 Jul 2021 21:29:18 +0200 Subject: patch 8.2.3139: functions for string manipulation are spread out Problem: Functions for string manipulation are spread out. Solution: Move string related functions to a new source file. (Yegappan Lakshmanan, closes #8470) --- src/misc1.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'src/misc1.c') diff --git a/src/misc1.c b/src/misc1.c index 7cac06b92..d112d9b95 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -695,7 +695,8 @@ f_mode(typval_T *argvars, typval_T *rettv) if (finish_op) { buf[1] = 'o'; - // to be able to detect force-linewise/blockwise/characterwise operations + // to be able to detect force-linewise/blockwise/characterwise + // operations buf[2] = motion_force; } else if (restart_edit == 'I' || restart_edit == 'R' @@ -2099,29 +2100,6 @@ match_user(char_u *name) return result; } -/* - * Concatenate two strings and return the result in allocated memory. - * Returns NULL when out of memory. - */ - char_u * -concat_str(char_u *str1, char_u *str2) -{ - char_u *dest; - size_t l = str1 == NULL ? 0 : STRLEN(str1); - - dest = alloc(l + (str2 == NULL ? 0 : STRLEN(str2)) + 1L); - if (dest != NULL) - { - if (str1 == NULL) - *dest = NUL; - else - STRCPY(dest, str1); - if (str2 != NULL) - STRCPY(dest + l, str2); - } - return dest; -} - static void prepare_to_exit(void) { -- cgit v1.2.1