summaryrefslogtreecommitdiffstats
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-09-30 12:02:55 +0000
committerBram Moolenaar <Bram@vim.org>2007-09-30 12:02:55 +0000
commitd089d9b33ac62ccc2783928a66c8f20499470920 (patch)
treea39eb1ed68513118c3e25482af67b556dbec02e0 /src/fileio.c
parent78ab331e0d8a76f553830f0347ac27311e4dc0f8 (diff)
updated for version 7.1-126v7.1.126
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 84416df083..39b4226355 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -114,7 +114,7 @@ struct bw_info
{
int bw_fd; /* file descriptor */
char_u *bw_buf; /* buffer with data to be written */
- int bw_len; /* lenght of data */
+ int bw_len; /* length of data */
#ifdef HAS_BW_FLAGS
int bw_flags; /* FIO_ flags */
#endif
@@ -5556,6 +5556,27 @@ make_bom(buf, name)
/*
* Try to find a shortname by comparing the fullname with the current
* directory.
+ * Returns "full_path" or pointer into "full_path" if shortened.
+ */
+ char_u *
+shorten_fname1(full_path)
+ char_u *full_path;
+{
+ char_u dirname[MAXPATHL];
+ char_u *p = full_path;
+
+ if (mch_dirname(dirname, MAXPATHL) == OK)
+ {
+ p = shorten_fname(full_path, dirname);
+ if (p == NULL || *p == NUL)
+ p = full_path;
+ }
+ return p;
+}
+
+/*
+ * Try to find a shortname by comparing the fullname with the current
+ * directory.
* Returns NULL if not shorter name possible, pointer into "full_path"
* otherwise.
*/