Mercurial > vim
diff src/filepath.c @ 17986:5c8906f653f5 v8.1.1989
patch 8.1.1989: the evalfunc.c file is still too big
Commit: https://github.com/vim/vim/commit/af7645d3733fdd3cd2df03ec7b653601d26969ef
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 5 22:33:28 2019 +0200
patch 8.1.1989: the evalfunc.c file is still too big
Problem: The evalfunc.c file is still too big.
Solution: Move f_pathshorten() to filepath.c. Move f_cscope_connection() to
if_cscope.c. Move diff_ functions to diff.c. Move timer_
functions to ex_cmds2.c. move callback functions to evalvars.c.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 05 Sep 2019 22:45:04 +0200 |
parents | 8f4cc259ed7a |
children | d1e77015f60b |
line wrap: on
line diff
--- a/src/filepath.c +++ b/src/filepath.c @@ -1311,6 +1311,27 @@ f_mkdir(typval_T *argvars, typval_T *ret } /* + * "pathshorten()" function + */ + void +f_pathshorten(typval_T *argvars, typval_T *rettv) +{ + char_u *p; + + rettv->v_type = VAR_STRING; + p = tv_get_string_chk(&argvars[0]); + if (p == NULL) + rettv->vval.v_string = NULL; + else + { + p = vim_strsave(p); + rettv->vval.v_string = p; + if (p != NULL) + shorten_dir(p); + } +} + +/* * "readdir()" function */ void