From 593df501b3a3687abb14a84299716bcd328b6ff8 Mon Sep 17 00:00:00 2001 From: watiko Date: Sun, 13 Dec 2015 12:19:54 +0900 Subject: vim-patch:7.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. https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801 --- src/nvim/garray.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/garray.c') diff --git a/src/nvim/garray.c b/src/nvim/garray.c index 75c3fb9a73..e6cbd9332b 100644 --- a/src/nvim/garray.c +++ b/src/nvim/garray.c @@ -174,6 +174,7 @@ char_u* ga_concat_strings(const garray_T *gap) FUNC_ATTR_NONNULL_RET } /// Concatenate a string to a growarray which contains characters. +/// When "s" is NULL does not do anything. /// /// WARNING: /// - Does NOT copy the NUL at the end! @@ -183,6 +184,10 @@ char_u* ga_concat_strings(const garray_T *gap) FUNC_ATTR_NONNULL_RET /// @param s void ga_concat(garray_T *gap, const char_u *restrict s) { + if (s == NULL) { + return; + } + int len = (int)strlen((char *) s); if (len) { ga_grow(gap, len); -- cgit