comparison src/alloc.c @ 28139:f34afadbef47 v8.2.4594

patch 8.2.4594: need to write script to a file to be able to source them Commit: https://github.com/vim/vim/commit/36a5b6867bb6c0bd69c8da7d788000ab8a0b0ab0 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sat Mar 19 12:56:51 2022 +0000 patch 8.2.4594: need to write script to a file to be able to source them Problem: Need to write script to a file to be able to source them. Solution: Make ":source" use lines from the current buffer. (Yegappan Lakshmanan et al., closes #9967)
author Bram Moolenaar <Bram@vim.org>
date Sat, 19 Mar 2022 14:00:03 +0100
parents c7f614c9ceb3
children ff649d0078d6
comparison
equal deleted inserted replaced
28138:d14809743aa0 28139:f34afadbef47
843 * When "s" is NULL does not do anything. 843 * When "s" is NULL does not do anything.
844 */ 844 */
845 void 845 void
846 ga_concat_len(garray_T *gap, char_u *s, size_t len) 846 ga_concat_len(garray_T *gap, char_u *s, size_t len)
847 { 847 {
848 if (s == NULL || *s == NUL) 848 if (s == NULL || *s == NUL || len == 0)
849 return; 849 return;
850 if (ga_grow(gap, (int)len) == OK) 850 if (ga_grow(gap, (int)len) == OK)
851 { 851 {
852 mch_memmove((char *)gap->ga_data + gap->ga_len, s, len); 852 mch_memmove((char *)gap->ga_data + gap->ga_len, s, len);
853 gap->ga_len += (int)len; 853 gap->ga_len += (int)len;