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.
diff --git a/src/findfile.c b/src/findfile.c
index 75d4a54..414dc4e 100644
--- a/src/findfile.c
+++ b/src/findfile.c
@@ -2815,3 +2815,19 @@
} 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