aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-02 08:27:53 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-02 08:30:16 -0400
commit4d396271e1b650f1225ea27240af8616283cfa39 (patch)
tree49ed9629882aba45fe296da338abfb3bef08eebc /src
parent5bfad093b2fd261f37c77ea9bbff366e3f4af545 (diff)
downloadrneovim-4d396271e1b650f1225ea27240af8616283cfa39.tar.gz
rneovim-4d396271e1b650f1225ea27240af8616283cfa39.tar.bz2
rneovim-4d396271e1b650f1225ea27240af8616283cfa39.zip
clang/API: copy "" if orig_save is NULL
orig_save can be NULL if ExpandOne() is misused if ExpandOne() is first called with mode "WILD_CANCEL" or "WILD_APPLY" before other modes.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_getln.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 76df01c205..38385d19b2 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -4093,9 +4093,10 @@ ExpandOne (
}
if (mode == WILD_CANCEL) {
- ss = vim_strsave(orig_save);
+ ss = vim_strsave(orig_save ? orig_save : (char_u *)"");
} else if (mode == WILD_APPLY) {
- ss = vim_strsave(findex == -1 ? orig_save : xp->xp_files[findex]);
+ ss = vim_strsave(findex == -1 ? (orig_save ? orig_save : (char_u *)"") :
+ xp->xp_files[findex]);
}
/* free old names */