diff options
-rw-r--r-- | src/eval.c | 25 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 17 insertions, 10 deletions
diff --git a/src/eval.c b/src/eval.c index 58317d29b..73844800c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -14292,18 +14292,23 @@ f_mkdir(argvars, rettv) return; dir = get_tv_string_buf(&argvars[0], buf); - if (*gettail(dir) == NUL) - /* remove trailing slashes */ - *gettail_sep(dir) = NUL; - - if (argvars[1].v_type != VAR_UNKNOWN) + if (*dir == NUL) + rettv->vval.v_number = FAIL; + else { - if (argvars[2].v_type != VAR_UNKNOWN) - prot = get_tv_number_chk(&argvars[2], NULL); - if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0) - mkdir_recurse(dir, prot); + if (*gettail(dir) == NUL) + /* remove trailing slashes */ + *gettail_sep(dir) = NUL; + + if (argvars[1].v_type != VAR_UNKNOWN) + { + if (argvars[2].v_type != VAR_UNKNOWN) + prot = get_tv_number_chk(&argvars[2], NULL); + if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0) + mkdir_recurse(dir, prot); + } + rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot); } - rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot); } #endif diff --git a/src/version.c b/src/version.c index 9b5343e9d..61694a467 100644 --- a/src/version.c +++ b/src/version.c @@ -728,6 +728,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 10, +/**/ 9, /**/ 8, |