diff src/misc2.c @ 11352:251f1833db7d v8.0.0561

patch 8.0.0561: undefined behavior when using backslash after empty line commit https://github.com/vim/vim/commit/478af67dd6a9adc456464c3736bda328ae3a28cb Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 10 22:22:42 2017 +0200 patch 8.0.0561: undefined behavior when using backslash after empty line Problem: Undefined behavior when using backslash after empty line. Solution: Check for an empty line. (Dominique Pelle, closes https://github.com/vim/vim/issues/1631)
author Christian Brabandt <cb@256bit.org>
date Mon, 10 Apr 2017 22:30:03 +0200
parents 121d29004998
children 7e5e76d8d451
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -2129,7 +2129,7 @@ ga_concat(garray_T *gap, char_u *s)
 {
     int    len;
 
-    if (s == NULL)
+    if (s == NULL || *s == NUL)
 	return;
     len = (int)STRLEN(s);
     if (ga_grow(gap, len) == OK)