summaryrefslogtreecommitdiffstats
path: root/src/findfile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-04 15:54:55 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-04 15:54:55 +0200
commitb005cd80cfda591be95146024d9b97eef383500f (patch)
treece7d5ac25d5c8e3442828130c180e04820565d29 /src/findfile.c
parent1e1d30048e722906a13665bd6c3c24c87eb2fe25 (diff)
patch 8.1.1979: code for handling file names is spread outv8.1.1979
Problem: Code for handling file names is spread out. Solution: Move code to new filepath.c file. Graduate FEAT_MODIFY_FNAME.
Diffstat (limited to 'src/findfile.c')
-rw-r--r--src/findfile.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/findfile.c b/src/findfile.c
index 75d4a541d0..414dc4e14a 100644
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -2815,3 +2815,19 @@ simplify_filename(char_u *filename)
} while (*p != NUL);
#endif // !AMIGA
}
+
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * "simplify()" function
+ */
+ void
+f_simplify(typval_T *argvars, typval_T *rettv)
+{
+ char_u *p;
+
+ p = tv_get_string(&argvars[0]);
+ rettv->vval.v_string = vim_strsave(p);
+ simplify_filename(rettv->vval.v_string); /* simplify in place */
+ rettv->v_type = VAR_STRING;
+}
+#endif // FEAT_EVAL