summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2015-11-29 17:35:35 +0100
committerBram Moolenaar <Bram@vim.org>2015-11-29 17:35:35 +0100
commit43345546ae63710441f066648b8485fb545b3801 (patch)
tree6856441fbdb36ee40e5225b97b1e0e698fc72d62 /src/misc2.c
parent48a969b48898fb08dce636c6b918408c6fbd3ea0 (diff)
downloadvim-git-43345546ae63710441f066648b8485fb545b3801.tar.gz
patch 7.4.944v7.4.944
Problem: Writing tests for Vim script is hard. Solution: Add assertEqual(), assertFalse() and assertTrue() functions. Add the v:errors variable. Add the runtest script. Add a first new style test script.
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 3f1568d10..beb3d4662 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -2092,6 +2092,7 @@ ga_concat_strings(gap, sep)
/*
* Concatenate a string to a growarray which contains characters.
+ * When "s" is NULL does not do anything.
* Note: Does NOT copy the NUL at the end!
*/
void
@@ -2099,8 +2100,11 @@ ga_concat(gap, s)
garray_T *gap;
char_u *s;
{
- int len = (int)STRLEN(s);
+ int len;
+ if (s == NULL)
+ return;
+ len = (int)STRLEN(s);
if (ga_grow(gap, len) == OK)
{
mch_memmove((char *)gap->ga_data + gap->ga_len, s, (size_t)len);