aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-05 20:47:46 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-11-06 20:03:00 -0500
commit0522962f1529109ee021949ee105ab03ae934bc5 (patch)
treedb7b37cc59da7a0f88b8a59d240a4b9585b95200 /src
parent40a742725ccd472038685ccb99090ee2a6b2c912 (diff)
downloadrneovim-0522962f1529109ee021949ee105ab03ae934bc5.tar.gz
rneovim-0522962f1529109ee021949ee105ab03ae934bc5.tar.bz2
rneovim-0522962f1529109ee021949ee105ab03ae934bc5.zip
vim-patch:8.2.1959: crash when terminal buffer name is made empty
Problem: Crash when terminal buffer name is made empty. (Dhiraj Mishra) Solution: Fall back to "[No Name]". (closes vim/vim#7262) https://github.com/vim/vim/commit/00806bceb6dc9c8dcd308e5f7e50f720f7dc71b0 N/A patches for version.c: vim-patch:8.1.2422: "make depend" does not work correctly for libvterm Problem: "make depend" does not work correctly for libvterm. Solution: Fix build dependencies. And a few minor improvements. https://github.com/vim/vim/commit/9810cfbe554b166cb05b51119040bb4426c17bac vim-patch:8.2.1962: netbeans may access freed memory Problem: Netbeans may access freed memory. Solution: Check the buffer pointer is still valid. Add a test. (Yegappan Lakshmanan, closes vim/vim#7248) https://github.com/vim/vim/commit/32e5ec0b017adb68fe36adb9a9a362abdaffe7f4 vim-patch:8.2.1963: crash when using a popup window with "latin1" encoding Problem: Crash when using a popup window with "latin1" encoding. Solution: Don't use ScreenLinesUC when enc_utf8 is false. (closes vim/vim#7241) https://github.com/vim/vim/commit/927495b1fef835a8f83c089bb3aa3608b617e972
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 7ea5a64a96..0ebe33f2f8 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -5416,7 +5416,7 @@ char_u *buf_spname(buf_T *buf)
return (char_u *)_("[Scratch]");
}
if (buf->b_fname == NULL) {
- return (char_u *)_("[No Name]");
+ return buf_get_fname(buf);
}
return NULL;
}
@@ -5477,6 +5477,16 @@ int buf_signcols(buf_T *buf)
return buf->b_signcols;
}
+// Get "buf->b_fname", use "[No Name]" if it is NULL.
+char_u *buf_get_fname(const buf_T *buf)
+ FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
+{
+ if (buf->b_fname == NULL) {
+ return (char_u *)_("[No Name]");
+ }
+ return buf->b_fname;
+}
+
/*
* Set 'buflisted' for curbuf to "on" and trigger autocommands if it changed.
*/