comparison src/eval.c @ 1406:396a9b65abe6 v7.1.121

updated for version 7.1-121
author vimboss
date Tue, 25 Sep 2007 18:40:14 +0000
parents b63792dadc23
children c0bb3c1dd446
comparison
equal deleted inserted replaced
1405:b63792dadc23 1406:396a9b65abe6
21306 { 21306 {
21307 valid |= VALID_HEAD; 21307 valid |= VALID_HEAD;
21308 *usedlen += 2; 21308 *usedlen += 2;
21309 s = get_past_head(*fnamep); 21309 s = get_past_head(*fnamep);
21310 while (tail > s && after_pathsep(s, tail)) 21310 while (tail > s && after_pathsep(s, tail))
21311 --tail; 21311 mb_ptr_back(*fnamep, tail);
21312 *fnamelen = (int)(tail - *fnamep); 21312 *fnamelen = (int)(tail - *fnamep);
21313 #ifdef VMS 21313 #ifdef VMS
21314 if (*fnamelen > 0) 21314 if (*fnamelen > 0)
21315 *fnamelen += 1; /* the path separator is part of the path */ 21315 *fnamelen += 1; /* the path separator is part of the path */
21316 #endif 21316 #endif
21317 while (tail > s && !after_pathsep(s, tail)) 21317 if (*fnamelen == 0)
21318 mb_ptr_back(*fnamep, tail); 21318 {
21319 /* Result is empty. Turn it into "." to make ":cd %:h" work. */
21320 p = vim_strsave((char_u *)".");
21321 if (p == NULL)
21322 return -1;
21323 vim_free(*bufp);
21324 *bufp = *fnamep = tail = p;
21325 *fnamelen = 1;
21326 }
21327 else
21328 {
21329 while (tail > s && !after_pathsep(s, tail))
21330 mb_ptr_back(*fnamep, tail);
21331 }
21319 } 21332 }
21320 21333
21321 /* ":8" - shortname */ 21334 /* ":8" - shortname */
21322 if (src[*usedlen] == ':' && src[*usedlen + 1] == '8') 21335 if (src[*usedlen] == ':' && src[*usedlen + 1] == '8')
21323 { 21336 {