aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/lua/executor.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 307b34a55c..4ac3c78b0a 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1738,7 +1738,9 @@ bool nlua_exec_file(const char *path)
if (read_size < 0) { // Error.
return false;
}
- kv_concat_len(sb, IObuff, (size_t)read_size);
+ if (read_size > 0) {
+ kv_concat_len(sb, IObuff, (size_t)read_size);
+ }
if (read_size < 64) { // EOF.
break;
}