diff src/misc1.c @ 25206:dc66d0284518 v8.2.3139

patch 8.2.3139: functions for string manipulation are spread out Commit: https://github.com/vim/vim/commit/a2438132a675be4dde3acbdf03ba1fdb2f09427c Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Jul 10 21:29:18 2021 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Sat, 10 Jul 2021 21:30:04 +0200
parents 53fd6370e4fd
children 34a6db7af738
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -695,7 +695,8 @@ f_mode(typval_T *argvars, typval_T *rett
 	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)
 {