Mercurial > vim
comparison src/buffer.c @ 39:410fa1a31baf v7.0023
updated for version 7.0023
author | vimboss |
---|---|
date | Sun, 19 Dec 2004 22:46:22 +0000 |
parents | 125e80798a85 |
children | f1d2a58883b9 |
comparison
equal
deleted
inserted
replaced
38:c524f99c7925 | 39:410fa1a31baf |
---|---|
2974 /* avoid "c:/name" to be reduced to "c" */ | 2974 /* avoid "c:/name" to be reduced to "c" */ |
2975 if (isalpha(buf[off]) && buf[off + 1] == ':') | 2975 if (isalpha(buf[off]) && buf[off + 1] == ':') |
2976 off += 2; | 2976 off += 2; |
2977 #endif | 2977 #endif |
2978 /* remove the file name */ | 2978 /* remove the file name */ |
2979 p = gettail(buf + off); | 2979 p = gettail_sep(buf + off); |
2980 if (p == buf + off) | 2980 if (p == buf + off) |
2981 { | |
2982 /* must be a help buffer */ | 2981 /* must be a help buffer */ |
2983 STRCPY(buf + off, _("help")); | 2982 STRCPY(buf + off, _("help")); |
2984 } | |
2985 else | 2983 else |
2986 { | |
2987 while (p > buf + off + 1 && vim_ispathsep(p[-1])) | |
2988 --p; | |
2989 #ifdef VMS | |
2990 /* path separator is part of the path */ | |
2991 ++p; | |
2992 #endif | |
2993 *p = NUL; | 2984 *p = NUL; |
2994 } | 2985 |
2995 /* translate unprintable chars */ | 2986 /* translate unprintable chars */ |
2996 p = transstr(buf + off); | 2987 p = transstr(buf + off); |
2997 STRNCPY(buf + off, p, IOSIZE - off); | 2988 STRNCPY(buf + off, p, IOSIZE - off); |
2998 vim_free(p); | 2989 vim_free(p); |
2999 buf[IOSIZE - 1] = NUL; /* in case it was too long */ | 2990 buf[IOSIZE - 1] = NUL; /* in case it was too long */ |