1
0
forked from aniani/vim

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)
This commit is contained in:
Yegappan Lakshmanan
2021-07-10 21:29:18 +02:00
committed by Bram Moolenaar
parent 31e21766d6
commit a2438132a6
21 changed files with 1673 additions and 1627 deletions

View File

@@ -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)
{