|
Karsten Hopp |
afbf38 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
afbf38 |
Subject: Patch 7.3.281
|
|
Karsten Hopp |
afbf38 |
Fcc: outbox
|
|
Karsten Hopp |
afbf38 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
afbf38 |
Mime-Version: 1.0
|
|
Karsten Hopp |
afbf38 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
afbf38 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
afbf38 |
------------
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
Patch 7.3.281
|
|
Karsten Hopp |
afbf38 |
Problem: After using "expand('%:8')" the buffer name is changed.
|
|
Karsten Hopp |
afbf38 |
Solution: Make a copy of the file name before shortening it.
|
|
Karsten Hopp |
afbf38 |
Files: src/eval.c
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
*** ../vim-7.3.280/src/eval.c 2011-08-10 12:38:02.000000000 +0200
|
|
Karsten Hopp |
afbf38 |
--- src/eval.c 2011-08-17 15:12:39.000000000 +0200
|
|
Karsten Hopp |
afbf38 |
***************
|
|
Karsten Hopp |
afbf38 |
*** 23205,23210 ****
|
|
Karsten Hopp |
afbf38 |
--- 23205,23211 ----
|
|
Karsten Hopp |
afbf38 |
int c;
|
|
Karsten Hopp |
afbf38 |
int has_fullname = 0;
|
|
Karsten Hopp |
afbf38 |
#ifdef WIN3264
|
|
Karsten Hopp |
afbf38 |
+ char_u *fname_start = *fnamep;
|
|
Karsten Hopp |
afbf38 |
int has_shortname = 0;
|
|
Karsten Hopp |
afbf38 |
#endif
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
***************
|
|
Karsten Hopp |
afbf38 |
*** 23379,23402 ****
|
|
Karsten Hopp |
afbf38 |
}
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
#ifdef WIN3264
|
|
Karsten Hopp |
afbf38 |
! /* Check shortname after we have done 'heads' and before we do 'tails'
|
|
Karsten Hopp |
afbf38 |
*/
|
|
Karsten Hopp |
afbf38 |
if (has_shortname)
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
! pbuf = NULL;
|
|
Karsten Hopp |
afbf38 |
! /* Copy the string if it is shortened by :h */
|
|
Karsten Hopp |
afbf38 |
! if (*fnamelen < (int)STRLEN(*fnamep))
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
p = vim_strnsave(*fnamep, *fnamelen);
|
|
Karsten Hopp |
afbf38 |
! if (p == 0)
|
|
Karsten Hopp |
afbf38 |
return -1;
|
|
Karsten Hopp |
afbf38 |
vim_free(*bufp);
|
|
Karsten Hopp |
afbf38 |
*bufp = *fnamep = p;
|
|
Karsten Hopp |
afbf38 |
}
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
/* Split into two implementations - makes it easier. First is where
|
|
Karsten Hopp |
afbf38 |
! * there isn't a full name already, second is where there is.
|
|
Karsten Hopp |
afbf38 |
! */
|
|
Karsten Hopp |
afbf38 |
if (!has_fullname && !vim_isAbsName(*fnamep))
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL)
|
|
Karsten Hopp |
afbf38 |
--- 23380,23404 ----
|
|
Karsten Hopp |
afbf38 |
}
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
#ifdef WIN3264
|
|
Karsten Hopp |
afbf38 |
! /*
|
|
Karsten Hopp |
afbf38 |
! * Handle ":8" after we have done 'heads' and before we do 'tails'.
|
|
Karsten Hopp |
afbf38 |
*/
|
|
Karsten Hopp |
afbf38 |
if (has_shortname)
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
! /* Copy the string if it is shortened by :h and when it wasn't copied
|
|
Karsten Hopp |
afbf38 |
! * yet, because we are going to change it in place. Avoids changing
|
|
Karsten Hopp |
afbf38 |
! * the buffer name for "%:8". */
|
|
Karsten Hopp |
afbf38 |
! if (*fnamelen < (int)STRLEN(*fnamep) || *fnamep == fname_start)
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
p = vim_strnsave(*fnamep, *fnamelen);
|
|
Karsten Hopp |
afbf38 |
! if (p == NULL)
|
|
Karsten Hopp |
afbf38 |
return -1;
|
|
Karsten Hopp |
afbf38 |
vim_free(*bufp);
|
|
Karsten Hopp |
afbf38 |
*bufp = *fnamep = p;
|
|
Karsten Hopp |
afbf38 |
}
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
/* Split into two implementations - makes it easier. First is where
|
|
Karsten Hopp |
afbf38 |
! * there isn't a full name already, second is where there is. */
|
|
Karsten Hopp |
afbf38 |
if (!has_fullname && !vim_isAbsName(*fnamep))
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL)
|
|
Karsten Hopp |
afbf38 |
***************
|
|
Karsten Hopp |
afbf38 |
*** 23404,23421 ****
|
|
Karsten Hopp |
afbf38 |
}
|
|
Karsten Hopp |
afbf38 |
else
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
! int l;
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
! /* Simple case, already have the full-name
|
|
Karsten Hopp |
afbf38 |
* Nearly always shorter, so try first time. */
|
|
Karsten Hopp |
afbf38 |
- l = *fnamelen;
|
|
Karsten Hopp |
afbf38 |
if (get_short_pathname(fnamep, bufp, &l) == FAIL)
|
|
Karsten Hopp |
afbf38 |
return -1;
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
if (l == 0)
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
! /* Couldn't find the filename.. search the paths.
|
|
Karsten Hopp |
afbf38 |
! */
|
|
Karsten Hopp |
afbf38 |
l = *fnamelen;
|
|
Karsten Hopp |
afbf38 |
if (shortpath_for_invalid_fname(fnamep, bufp, &l) == FAIL)
|
|
Karsten Hopp |
afbf38 |
return -1;
|
|
Karsten Hopp |
afbf38 |
--- 23406,23421 ----
|
|
Karsten Hopp |
afbf38 |
}
|
|
Karsten Hopp |
afbf38 |
else
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
! int l = *fnamelen;
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
! /* Simple case, already have the full-name.
|
|
Karsten Hopp |
afbf38 |
* Nearly always shorter, so try first time. */
|
|
Karsten Hopp |
afbf38 |
if (get_short_pathname(fnamep, bufp, &l) == FAIL)
|
|
Karsten Hopp |
afbf38 |
return -1;
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
if (l == 0)
|
|
Karsten Hopp |
afbf38 |
{
|
|
Karsten Hopp |
afbf38 |
! /* Couldn't find the filename, search the paths. */
|
|
Karsten Hopp |
afbf38 |
l = *fnamelen;
|
|
Karsten Hopp |
afbf38 |
if (shortpath_for_invalid_fname(fnamep, bufp, &l) == FAIL)
|
|
Karsten Hopp |
afbf38 |
return -1;
|
|
Karsten Hopp |
afbf38 |
*** ../vim-7.3.280/src/version.c 2011-08-10 18:36:49.000000000 +0200
|
|
Karsten Hopp |
afbf38 |
--- src/version.c 2011-08-17 15:21:41.000000000 +0200
|
|
Karsten Hopp |
afbf38 |
***************
|
|
Karsten Hopp |
afbf38 |
*** 711,712 ****
|
|
Karsten Hopp |
afbf38 |
--- 711,714 ----
|
|
Karsten Hopp |
afbf38 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
afbf38 |
+ /**/
|
|
Karsten Hopp |
afbf38 |
+ 281,
|
|
Karsten Hopp |
afbf38 |
/**/
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
--
|
|
Karsten Hopp |
afbf38 |
Kisses may last for as much as, but no more than, five minutes.
|
|
Karsten Hopp |
afbf38 |
[real standing law in Iowa, United States of America]
|
|
Karsten Hopp |
afbf38 |
|
|
Karsten Hopp |
afbf38 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
afbf38 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
afbf38 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
afbf38 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|