diff src/findfile.c @ 17966:46f95606b9ec v8.1.1979

patch 8.1.1979: code for handling file names is spread out Commit: https://github.com/vim/vim/commit/b005cd80cfda591be95146024d9b97eef383500f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Sep 4 15:54:55 2019 +0200 patch 8.1.1979: code for handling file names is spread out Problem: Code for handling file names is spread out. Solution: Move code to new filepath.c file. Graduate FEAT_MODIFY_FNAME.
author Bram Moolenaar <Bram@vim.org>
date Wed, 04 Sep 2019 16:00:04 +0200
parents 0f7ae8010787
children c8a53c0daeed
line wrap: on
line diff
--- 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