summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2007-09-25 18:40:14 +0000
committervimboss <devnull@localhost>2007-09-25 18:40:14 +0000
commitacdaf20408ba7aa6a2dc4cd8dc2cae91063c08fd (patch)
treeaa5558f6f8083862ddc943d8ca008ed8d91e5b2f
parenta6dc2c4f2692bf4a0e4600504e27b6f92d27a37e (diff)
downloadvim-acdaf20408ba7aa6a2dc4cd8dc2cae91063c08fd.tar.gz
updated for version 7.1-121v7.1.121v7-1-121
-rw-r--r--src/eval.c19
-rw-r--r--src/version.c2
2 files changed, 18 insertions, 3 deletions
diff --git a/src/eval.c b/src/eval.c
index 61d7df4c..740b8dd4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -21308,14 +21308,27 @@ repeat:
*usedlen += 2;
s = get_past_head(*fnamep);
while (tail > s && after_pathsep(s, tail))
- --tail;
+ mb_ptr_back(*fnamep, tail);
*fnamelen = (int)(tail - *fnamep);
#ifdef VMS
if (*fnamelen > 0)
*fnamelen += 1; /* the path separator is part of the path */
#endif
- while (tail > s && !after_pathsep(s, tail))
- mb_ptr_back(*fnamep, tail);
+ if (*fnamelen == 0)
+ {
+ /* Result is empty. Turn it into "." to make ":cd %:h" work. */
+ p = vim_strsave((char_u *)".");
+ if (p == NULL)
+ return -1;
+ vim_free(*bufp);
+ *bufp = *fnamep = tail = p;
+ *fnamelen = 1;
+ }
+ else
+ {
+ while (tail > s && !after_pathsep(s, tail))
+ mb_ptr_back(*fnamep, tail);
+ }
}
/* ":8" - shortname */
diff --git a/src/version.c b/src/version.c
index 0f90b8b4..aeeb316a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 121,
+/**/
120,
/**/
119,