Remove nonnullret deadcode: vim_strsave.

This commit is contained in:
Eliseo Martínez
2015-01-23 14:17:33 +01:00
parent ce5b476dd9
commit d228b8a93e
6 changed files with 14 additions and 31 deletions

View File

@@ -239,33 +239,31 @@ int vim_ispathlistsep(int c)
* Shorten the path of a file from "~/foo/../.bar/fname" to "~/f/../.b/fname"
* It's done in-place.
*/
void shorten_dir(char_u *str)
char_u *shorten_dir(char_u *str)
{
char_u *tail, *s, *d;
int skip = FALSE;
tail = path_tail(str);
d = str;
for (s = str;; ++s) {
char_u *tail = path_tail(str);
char_u *d = str;
bool skip = false;
for (char_u *s = str;; ++s) {
if (s >= tail) { /* copy the whole tail */
*d++ = *s;
if (*s == NUL)
break;
} else if (vim_ispathsep(*s)) { /* copy '/' and next char */
*d++ = *s;
skip = FALSE;
skip = false;
} else if (!skip) {
*d++ = *s; /* copy next char */
if (*s != '~' && *s != '.') /* and leading "~" and "." */
skip = TRUE;
skip = true;
if (has_mbyte) {
int l = mb_ptr2len(s);
while (--l > 0)
*d++ = *++s;
}
}
}
return str;
}
/*