comparison 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
comparison
equal deleted inserted replaced
1410:cdd82acd75b4 1411:0e6b369b9760
112 */ 112 */
113 struct bw_info 113 struct bw_info
114 { 114 {
115 int bw_fd; /* file descriptor */ 115 int bw_fd; /* file descriptor */
116 char_u *bw_buf; /* buffer with data to be written */ 116 char_u *bw_buf; /* buffer with data to be written */
117 int bw_len; /* lenght of data */ 117 int bw_len; /* length of data */
118 #ifdef HAS_BW_FLAGS 118 #ifdef HAS_BW_FLAGS
119 int bw_flags; /* FIO_ flags */ 119 int bw_flags; /* FIO_ flags */
120 #endif 120 #endif
121 #ifdef FEAT_MBYTE 121 #ifdef FEAT_MBYTE
122 char_u bw_rest[CONV_RESTLEN]; /* not converted bytes */ 122 char_u bw_rest[CONV_RESTLEN]; /* not converted bytes */
5554 #endif 5554 #endif
5555 5555
5556 /* 5556 /*
5557 * Try to find a shortname by comparing the fullname with the current 5557 * Try to find a shortname by comparing the fullname with the current
5558 * directory. 5558 * directory.
5559 * Returns "full_path" or pointer into "full_path" if shortened.
5560 */
5561 char_u *
5562 shorten_fname1(full_path)
5563 char_u *full_path;
5564 {
5565 char_u dirname[MAXPATHL];
5566 char_u *p = full_path;
5567
5568 if (mch_dirname(dirname, MAXPATHL) == OK)
5569 {
5570 p = shorten_fname(full_path, dirname);
5571 if (p == NULL || *p == NUL)
5572 p = full_path;
5573 }
5574 return p;
5575 }
5576
5577 /*
5578 * Try to find a shortname by comparing the fullname with the current
5579 * directory.
5559 * Returns NULL if not shorter name possible, pointer into "full_path" 5580 * Returns NULL if not shorter name possible, pointer into "full_path"
5560 * otherwise. 5581 * otherwise.
5561 */ 5582 */
5562 char_u * 5583 char_u *
5563 shorten_fname(full_path, dir_name) 5584 shorten_fname(full_path, dir_name)