Mercurial > vim
diff src/fileio.c @ 1411:0e6b369b9760 v7.1.126
updated for version 7.1-126
author | vimboss |
---|---|
date | Sun, 30 Sep 2007 12:02:55 +0000 |
parents | cdd82acd75b4 |
children | bac7c3fce150 |
line wrap: on
line diff
--- 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. */