summaryrefslogtreecommitdiffstats
path: root/src/filepath.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-05 22:33:28 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-05 22:33:28 +0200
commitaf7645d3733fdd3cd2df03ec7b653601d26969ef (patch)
tree1b3c3d1d0d6428c33026693a5086910cca8b3078 /src/filepath.c
parent8d3b51084a5bdcd2ee9e31bc03cba0d16c43d428 (diff)
patch 8.1.1989: the evalfunc.c file is still too bigv8.1.1989
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.
Diffstat (limited to 'src/filepath.c')
-rw-r--r--src/filepath.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/filepath.c b/src/filepath.c
index 21cd767c53..811682e375 100644
--- a/src/filepath.c
+++ b/src/filepath.c
@@ -1311,6 +1311,27 @@ f_mkdir(typval_T *argvars, typval_T *rettv)
}
/*
+ * "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