9941f6d
To: vim-dev@vim.org
9941f6d
Subject: Patch 7.2.438
9941f6d
Fcc: outbox
9941f6d
From: Bram Moolenaar <Bram@moolenaar.net>
9941f6d
Mime-Version: 1.0
9941f6d
Content-Type: text/plain; charset=UTF-8
9941f6d
Content-Transfer-Encoding: 8bit
9941f6d
------------
9941f6d
9941f6d
Patch 7.2.438 (after 7.2.427)
9941f6d
Problem:    "vim -r" crashes.
9941f6d
Solution:   Don't use NULL pointer argument.
9941f6d
Files:	    src/memline.c
9941f6d
9941f6d
9941f6d
*** ../vim-7.2.437/src/memline.c	2010-05-14 17:52:35.000000000 +0200
9941f6d
--- src/memline.c	2010-05-25 21:36:01.000000000 +0200
9941f6d
***************
9941f6d
*** 1404,1418 ****
9941f6d
      int		i;
9941f6d
      char_u	*dirp;
9941f6d
      char_u	*dir_name;
9941f6d
!     char_u	*fname_res = *fname;
9941f6d
  #ifdef HAVE_READLINK
9941f6d
      char_u	fname_buf[MAXPATHL];
9941f6d
  
9941f6d
      /* Expand symlink in the file name, because the swap file is created with
9941f6d
       * the actual file instead of with the symlink. */
9941f6d
      if (resolve_symlink(*fname, fname_buf) == OK)
9941f6d
  	fname_res = fname_buf;
9941f6d
  #endif
9941f6d
  
9941f6d
      if (list)
9941f6d
      {
9941f6d
--- 1404,1425 ----
9941f6d
      int		i;
9941f6d
      char_u	*dirp;
9941f6d
      char_u	*dir_name;
9941f6d
!     char_u	*fname_res = NULL;
9941f6d
  #ifdef HAVE_READLINK
9941f6d
      char_u	fname_buf[MAXPATHL];
9941f6d
+ #endif
9941f6d
  
9941f6d
+     if (fname != NULL)
9941f6d
+     {
9941f6d
+ #ifdef HAVE_READLINK
9941f6d
      /* Expand symlink in the file name, because the swap file is created with
9941f6d
       * the actual file instead of with the symlink. */
9941f6d
      if (resolve_symlink(*fname, fname_buf) == OK)
9941f6d
  	fname_res = fname_buf;
9941f6d
+     else
9941f6d
  #endif
9941f6d
+ 	fname_res = *fname;
9941f6d
+     }
9941f6d
  
9941f6d
      if (list)
9941f6d
      {
9941f6d
*** ../vim-7.2.437/src/version.c	2010-05-21 13:08:51.000000000 +0200
9941f6d
--- src/version.c	2010-05-25 21:30:12.000000000 +0200
9941f6d
***************
9941f6d
*** 683,684 ****
9941f6d
--- 683,686 ----
9941f6d
  {   /* Add new patch number below this line */
9941f6d
+ /**/
9941f6d
+     438,
9941f6d
  /**/
9941f6d
9941f6d
-- 
9941f6d
A fool learns from his mistakes, a wise man from someone else's.
9941f6d
9941f6d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
9941f6d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
9941f6d
\\\        download, build and distribute -- http://www.A-A-P.org        ///
9941f6d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///