home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.181 < prev    next >
Encoding:
Internet Message Format  |  2002-02-03  |  2.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.181
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.181
  11. Problem:    When using ":cd dir" memory was leaked.
  12. Solution:   Free the allocated memory.  Also avoid an uninitialized memory
  13.         read.
  14. Files:        src/misc2.c
  15.  
  16.  
  17. *** ../vim60.180/src/misc2.c    Thu Nov  1 21:25:14 2001
  18. --- src/misc2.c    Mon Feb  4 22:05:55 2002
  19. ***************
  20. *** 3540,3546 ****
  21.       {
  22.   #ifdef BACKSLASH_IN_FILENAME
  23.       /* "c:dir" needs "c:" to be expanded, otherwise use current dir */
  24. !     if (path[1] == ':')
  25.       {
  26.           char_u  drive[3];
  27.   
  28. --- 3540,3546 ----
  29.       {
  30.   #ifdef BACKSLASH_IN_FILENAME
  31.       /* "c:dir" needs "c:" to be expanded, otherwise use current dir */
  32. !     if (*path != NUL && path[1] == ':')
  33.       {
  34.           char_u  drive[3];
  35.   
  36. ***************
  37. *** 4974,4985 ****
  38.       return mch_chdir((char *)new_dir);
  39.   #else
  40.       char_u    *dir_name;
  41.   
  42.       dir_name = find_directory_in_path(new_dir, (int)STRLEN(new_dir),
  43.                           FNAME_MESS, curbuf->b_ffname);
  44.       if (dir_name == NULL)
  45.       return -1;
  46. !     return mch_chdir((char *)dir_name);
  47.   #endif
  48.   }
  49.   
  50. --- 4974,4988 ----
  51.       return mch_chdir((char *)new_dir);
  52.   #else
  53.       char_u    *dir_name;
  54. +     int        r;
  55.   
  56.       dir_name = find_directory_in_path(new_dir, (int)STRLEN(new_dir),
  57.                           FNAME_MESS, curbuf->b_ffname);
  58.       if (dir_name == NULL)
  59.       return -1;
  60. !     r = mch_chdir((char *)dir_name);
  61. !     vim_free(dir_name);
  62. !     return r;
  63.   #endif
  64.   }
  65.   
  66. *** ../vim60.180/src/version.c    Mon Feb  4 22:37:41 2002
  67. --- src/version.c    Mon Feb  4 22:38:41 2002
  68. ***************
  69. *** 608,609 ****
  70. --- 608,611 ----
  71.   {   /* Add new patch number below this line */
  72. + /**/
  73. +     181,
  74.   /**/
  75.  
  76. -- 
  77.     "You mean there really is an answer?"
  78.     "Yes! But you're not going to like it!"
  79.     "Oh do please tell us!"
  80.     "You're really not going to like it!"
  81.     "but we MUST know - tell us"
  82.     "Alright, the answer is...."
  83.     "yes..."
  84.     "... is ..."
  85.     "yes... come on!"
  86.     "is 42!"
  87.         (Douglas Adams - The Hitchhiker's Guide to the Galaxy)
  88.  
  89.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  90. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  91.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  92.