diff --git a/src/filepath.c b/src/filepath.c index 347612a802..0db0dcfb1f 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -1019,7 +1019,7 @@ f_fnamemodify(typval_T *argvars, typval_T *rettv) char_u *fname; char_u *mods; int usedlen = 0; - int len; + int len = 0; char_u *fbuf = NULL; char_u buf[NUMBUFLEN]; @@ -1028,12 +1028,13 @@ f_fnamemodify(typval_T *argvars, typval_T *rettv) return; fname = tv_get_string_chk(&argvars[0]); mods = tv_get_string_buf_chk(&argvars[1], buf); - if (fname == NULL) + if (mods == NULL || fname == NULL) fname = NULL; - else if (mods != NULL && *mods != NUL) + else { len = (int)STRLEN(fname); - (void)modify_fname(mods, FALSE, &usedlen, &fname, &fbuf, &len); + if (mods != NULL && *mods != NUL) + (void)modify_fname(mods, FALSE, &usedlen, &fname, &fbuf, &len); } rettv->v_type = VAR_STRING; diff --git a/src/version.c b/src/version.c index 7f78742acd..0cb1d92974 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2136, /**/ 2135, /**/