diff options
author | watiko <service@mail.watiko.net> | 2015-12-13 12:19:54 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-01-10 09:01:30 +0900 |
commit | 593df501b3a3687abb14a84299716bcd328b6ff8 (patch) | |
tree | 5b9b9a381ea8f25d60e35a3be65f483703a33a7b /src/nvim/garray.c | |
parent | 50db0312f941ba489466d7d6b21088f1870429ee (diff) | |
download | rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.tar.gz rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.tar.bz2 rneovim-593df501b3a3687abb14a84299716bcd328b6ff8.zip |
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
Diffstat (limited to 'src/nvim/garray.c')
-rw-r--r-- | src/nvim/garray.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |