summaryrefslogtreecommitdiffstats
path: root/src/filepath.c
diff options
context:
space:
mode:
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