On 25-May-2010 James Vega <james...@jamessan.com> wrote:
> On Fri, May 14, 2010 at 11:53 AM, Bram Moolenaar <b...@moolenaar.net> wrote:
> >
> > 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
> 
> After this patch, “vim -r” (no arguments) crashes.  Attached patch fixes
> it.

The attached patch seems to fix the problem.

-- 
Cheers,
Lech

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/src/memline.c b/src/memline.c
index 74f94ed..9f6f637 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -1404,13 +1404,14 @@ recover_names(fname, list, nr)
     int		i;
     char_u	*dirp;
     char_u	*dir_name;
-    char_u	*fname_res = *fname;
+    char_u	*fname_res = fname ? *fname
+				   : NULL;
 #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)
+    if (fname && resolve_symlink(*fname, fname_buf) == OK)
 	fname_res = fname_buf;
 #endif
 

Reply via email to