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 / 7.3 / 7.3.701 < prev    next >
Encoding:
Internet Message Format  |  2012-11-20  |  2.6 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.701
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.701
  11. Problem:    MS-Windows: Crash with stack overflow when setting 'encoding'.
  12. Solution:   Handle that loading the iconv library may be called recursively.
  13.             (Jiri Sedlak)
  14. Files:      src/os_win32.c
  15.  
  16.  
  17. *** ../vim-7.3.700/src/os_win32.c    2012-08-02 12:31:40.000000000 +0200
  18. --- src/os_win32.c    2012-10-21 02:35:21.000000000 +0200
  19. ***************
  20. *** 288,305 ****
  21.   vimLoadLib(char *name)
  22.   {
  23.       HINSTANCE dll = NULL;
  24. !     char old_dir[MAXPATHL];
  25.   
  26.       if (exe_path == NULL)
  27.       get_exe_name();
  28. !     if (exe_path != NULL && mch_dirname(old_dir, MAXPATHL) == OK)
  29.       {
  30.       /* Change directory to where the executable is, both to make sure we
  31.        * find a .dll there and to avoid looking for a .dll in the current
  32.        * directory. */
  33. !     mch_chdir(exe_path);
  34.       dll = LoadLibrary(name);
  35. -     mch_chdir(old_dir);
  36.       }
  37.       return dll;
  38.   }
  39. --- 288,313 ----
  40.   vimLoadLib(char *name)
  41.   {
  42.       HINSTANCE dll = NULL;
  43. !     TCHAR old_dir[MAXPATHL];
  44.   
  45. +     /* NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
  46. +      * vimLoadLib() recursively, which causes a stack overflow. */
  47.       if (exe_path == NULL)
  48.       get_exe_name();
  49. !     if (exe_path != NULL && GetCurrentDirectory(MAXPATHL, old_dir) != 0)
  50.       {
  51.       /* Change directory to where the executable is, both to make sure we
  52.        * find a .dll there and to avoid looking for a .dll in the current
  53.        * directory. */
  54. !     SetCurrentDirectory(exe_path);
  55. !     dll = LoadLibrary(name);
  56. !     SetCurrentDirectory(old_dir);
  57. !     }
  58. !     else
  59. !     {
  60. !     /* We are not able to change directory to where the executable is, try
  61. !      * to load library anyway. */
  62.       dll = LoadLibrary(name);
  63.       }
  64.       return dll;
  65.   }
  66. *** ../vim-7.3.700/src/version.c    2012-10-21 02:17:28.000000000 +0200
  67. --- src/version.c    2012-10-21 02:35:48.000000000 +0200
  68. ***************
  69. *** 721,722 ****
  70. --- 721,724 ----
  71.   {   /* Add new patch number below this line */
  72. + /**/
  73. +     701,
  74.   /**/
  75.  
  76. -- 
  77. BEDEVERE: And that, my lord, is how we know the Earth to be banana-shaped.
  78.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  79.  
  80.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  81. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  82. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  83.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  84.