From 3026a5f41db83ff3af83dd9064461c4c15eaed64 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 13 Dec 2020 12:04:16 -0500 Subject: [PATCH] vim-patch:8.2.2136: Vim9: Using uninitialized variable Problem: Vim9: Using uninitialized variable. Solution: Initialize "len" to zero. Clean up fnamemodify(). https://github.com/vim/vim/commit/c530852315517a44354edbbd6c3375355bbec37e N/A patches for version.c: vim-patch:8.1.0839: when using VTP wrong colors after a color scheme change Problem: When using VTP wrong colors after a color scheme change. Solution: When VTP is active always clear after a color scheme change. (Nobuhiro Takasaki, closes vim/vim#3872) https://github.com/vim/vim/commit/f58d81a18752cb9bf899b3f7328fc489cf6558e8 vim-patch:8.1.2382: MS-Windows: When using VTP bold+inverse doesn't work Problem: MS-Windows: When using VTP bold+inverse doesn't work. Solution: Compare with the default colors. (Nobuhiro Takasaki, closes vim/vim#5303) https://github.com/vim/vim/commit/a050b9471c66b383ed674bfd57ac78016199d972 vim-patch:8.2.0669: MS-Windows: display in VTP is a bit slow Problem: MS-Windows: display in VTP is a bit slow. Solution: Optimize the code. (Nobuhiro Takasaki, closes vim/vim#6014) https://github.com/vim/vim/commit/4e5534fab798ab7c95554da3bc80b08336aedc2b vim-patch:8.2.0739: incomplete profiling when exiting because of a dealy signal Problem: Incomplete profiling when exiting because of a dealy signal. Solution: Call __gcov_flush() if available. https://github.com/vim/vim/commit/b415168a9862023462b7193e83da948cb8d11893 vim-patch:8.2.1911: tiny build fails Problem: Tiny build fails. Solution: Add #ifdef. https://github.com/vim/vim/commit/977fd0b327ed46a71c80d2cd62cbe149d43b9a69 vim-patch:8.2.2140: build failure with tiny features Problem: Build failure with tiny features. Solution: Add #ifdef. https://github.com/vim/vim/commit/2a3cd3af455973d678f70303ebdd486f3478bc0d --- src/nvim/eval/funcs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index b56034b92d..89d9a85775 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2463,7 +2463,7 @@ static void f_fnameescape(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char_u *fbuf = NULL; - size_t len; + size_t len = 0; char buf[NUMBUFLEN]; const char *fname = tv_get_string_chk(&argvars[0]); const char *const mods = tv_get_string_buf_chk(&argvars[1], buf); @@ -2472,8 +2472,10 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) } else { len = strlen(fname); size_t usedlen = 0; - (void)modify_fname((char_u *)mods, false, &usedlen, - (char_u **)&fname, &fbuf, &len); + if (mods != NULL && *mods != NUL) { + (void)modify_fname((char_u *)mods, false, &usedlen, + (char_u **)&fname, &fbuf, &len); + } } rettv->v_type = VAR_STRING;