diff --git a/7.2.427 b/7.2.427 new file mode 100644 index 0000000..c640650 --- /dev/null +++ b/7.2.427 @@ -0,0 +1,207 @@ +To: vim-dev@vim.org +Subject: Patch 7.2.427 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.2.427 +Problem: The swapfile is created using the destination of a symlink, but + recovery doesn't follow symlinks. +Solution: When recovering, resolve symlinks. (James Vega) +Files: src/memline.c + + +*** ../vim-7.2.426/src/memline.c 2010-03-10 14:46:21.000000000 +0100 +--- src/memline.c 2010-05-14 17:28:29.000000000 +0200 +*************** +*** 245,250 **** +--- 245,253 ---- + #ifdef FEAT_BYTEOFF + static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype)); + #endif ++ #ifdef HAVE_READLINK ++ static int resolve_symlink __ARGS((char_u *fname, char_u *buf)); ++ #endif + + /* + * Open a new memline for "buf". +*************** +*** 1401,1410 **** + int i; + char_u *dirp; + char_u *dir_name; + + if (list) + { +! /* use msg() to start the scrolling properly */ + msg((char_u *)_("Swap files found:")); + msg_putchar('\n'); + } +--- 1404,1422 ---- + int i; + char_u *dirp; + char_u *dir_name; ++ char_u *fname_res = *fname; ++ #ifdef HAVE_READLINK ++ char_u fname_buf[MAXPATHL]; ++ ++ /* Expand symlink in the file name, because the swap file is created with ++ * the actual file instead of with the symlink. */ ++ if (resolve_symlink(*fname, fname_buf) == OK) ++ fname_res = fname_buf; ++ #endif + + if (list) + { +! /* use msg() to start the scrolling properly */ + msg((char_u *)_("Swap files found:")); + msg_putchar('\n'); + } +*************** +*** 1453,1459 **** + #endif + } + else +! num_names = recov_file_names(names, *fname, TRUE); + } + else /* check directory dir_name */ + { +--- 1465,1471 ---- + #endif + } + else +! num_names = recov_file_names(names, fname_res, TRUE); + } + else /* check directory dir_name */ + { +*************** +*** 1490,1501 **** + if (after_pathsep(dir_name, p) && p[-1] == p[-2]) + { + /* Ends with '//', Use Full path for swap name */ +! tail = make_percent_swname(dir_name, *fname); + } + else + #endif + { +! tail = gettail(*fname); + tail = concat_fnames(dir_name, tail, TRUE); + } + if (tail == NULL) +--- 1502,1513 ---- + if (after_pathsep(dir_name, p) && p[-1] == p[-2]) + { + /* Ends with '//', Use Full path for swap name */ +! tail = make_percent_swname(dir_name, fname_res); + } + else + #endif + { +! tail = gettail(fname_res); + tail = concat_fnames(dir_name, tail, TRUE); + } + if (tail == NULL) +*************** +*** 1535,1545 **** + struct stat st; + char_u *swapname; + + #if defined(VMS) || defined(RISCOS) +! swapname = modname(*fname, (char_u *)"_swp", FALSE); + #else +! swapname = modname(*fname, (char_u *)".swp", TRUE); + #endif + if (swapname != NULL) + { + if (mch_stat((char *)swapname, &st) != -1) /* It exists! */ +--- 1547,1559 ---- + struct stat st; + char_u *swapname; + ++ swapname = modname(fname_res, + #if defined(VMS) || defined(RISCOS) +! (char_u *)"_swp", FALSE + #else +! (char_u *)".swp", TRUE + #endif ++ ); + if (swapname != NULL) + { + if (mch_stat((char *)swapname, &st) != -1) /* It exists! */ +*************** +*** 3508,3515 **** + } + + #ifdef HAVE_READLINK +- static int resolve_symlink __ARGS((char_u *fname, char_u *buf)); +- + /* + * Resolve a symlink in the last component of a file name. + * Note that f_resolve() does it for every part of the path, we don't do that +--- 3522,3527 ---- +*************** +*** 3601,3609 **** + char_u *dir_name; + { + char_u *r, *s; + #ifdef HAVE_READLINK + char_u fname_buf[MAXPATHL]; +- char_u *fname_res; + #endif + + #if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */ +--- 3613,3621 ---- + char_u *dir_name; + { + char_u *r, *s; ++ char_u *fname_res = fname; + #ifdef HAVE_READLINK + char_u fname_buf[MAXPATHL]; + #endif + + #if defined(UNIX) || defined(WIN3264) /* Need _very_ long file names */ +*************** +*** 3625,3632 **** + * actual file instead of with the symlink. */ + if (resolve_symlink(fname, fname_buf) == OK) + fname_res = fname_buf; +- else +- fname_res = fname; + #endif + + r = buf_modname( +--- 3637,3642 ---- +*************** +*** 3639,3649 **** + /* Avoid problems if fname has special chars, eg */ + ffname, + #else +- # ifdef HAVE_READLINK + fname_res, +- # else +- fname, +- # endif + #endif + (char_u *) + #if defined(VMS) || defined(RISCOS) +--- 3649,3655 ---- +*** ../vim-7.2.426/src/version.c 2010-05-14 17:32:53.000000000 +0200 +--- src/version.c 2010-05-14 17:50:43.000000000 +0200 +*************** +*** 683,684 **** +--- 683,686 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 427, + /**/ + +-- +Change is inevitable, except from a vending machine. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ download, build and distribute -- http://www.A-A-P.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/README.patches b/README.patches index 6ae690e..9ead745 100644 --- a/README.patches +++ b/README.patches @@ -454,3 +454,8 @@ Individual patches for Vim 7.2: 2792 7.2.420 ":argedit" does not accept "++enc=utf8" as documented 2108 7.2.421 when folds are not updated there is no way to force an update 2174 7.2.422 may get E763 when using spell dictionaries + 4478 7.2.423 crash after assigning s: to variable + 5462 7.2.424 ":colorscheme" without an argument doesn't do anything + 1541 7.2.425 some compilers complain about fourth EX() argument + 2771 7.2.426 commas in 'langmap' are not always handled correctly + 5351 7.2.427 recovery doesn't follow symlinks to find swap file diff --git a/vim.spec b/vim.spec index bed7ff1..4556bd0 100644 --- a/vim.spec +++ b/vim.spec @@ -18,7 +18,7 @@ #used for pre-releases: %define beta %{nil} %define vimdir vim72%{?beta} -%define patchlevel 422 +%define patchlevel 427 Summary: The VIM editor URL: http://www.vim.org/ @@ -488,6 +488,11 @@ Patch419: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.419 Patch420: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.420 Patch421: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.421 Patch422: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.422 +Patch423: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.423 +Patch424: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.424 +Patch425: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.425 +Patch426: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.426 +Patch427: ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.427 Patch3000: vim-7.0-syntax.patch Patch3002: vim-7.1-nowarnings.patch @@ -1048,6 +1053,11 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch420 -p0 %patch421 -p0 %patch422 -p0 +%patch423 -p0 +%patch424 -p0 +%patch425 -p0 +%patch426 -p0 +%patch427 -p0 # install spell files @@ -1512,6 +1522,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/icons/hicolor/*/apps/* %changelog +* Fri May 14 2010 Karsten Hopp 7.2.427-1 +- patchlevel 427 + * Thu May 13 2010 Karsten Hopp 7.2.422-1 - patchlevel 422