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 / old / 5.4.x3 < prev    next >
Encoding:
Internet Message Format  |  1999-08-12  |  2.6 KB

  1. To: "Demirel, Kayhan" <kayhan.demirel@sap-ag.de>
  2. In-Reply-To: <2BC52EF1968FD211B3AB00805FE6FE82014F602B@uspalx21.pal.sap-ag.de>
  3. Subject: patch 5.4.x3 (was: vim 5.4 crash under NT)
  4. Fcc: outbox
  5. From: Bram Moolenaar <Bram@moolenaar.net>
  6. ------------
  7.  
  8. Kayhan Demirel wrote:
  9.  
  10. > When I drag a directory (and not a file) on gvim 5.4 (-u NONE -U NONE)
  11. > it crashes ... (NT 4 Workstation using nt explorer)
  12.  
  13. I can reproduce it, also on Windows 98.  It appears that a NULL pointer is
  14. used when trying to open the directory as a file.  That needs to be fixed.
  15.  
  16.  
  17. Patch 5.4.x3
  18. Problem:    Win32 GUI: When dropping a directory on a running gvim it crashes.
  19. Solution:   Avoid using a NULL file name.  Also display a message to indicate
  20.             that the current directory was changed.
  21. Files:      src/gui_w32.c
  22.  
  23.  
  24. *** ../vim-5.4.24/src/gui_w32.c    Tue Aug 10 16:11:57 1999
  25. --- src/gui_w32.c    Fri Aug 13 11:50:26 1999
  26. ***************
  27. *** 669,699 ****
  28.   
  29.       /*
  30.        * Handle dropping a directory on Vim.
  31.        */
  32. !     if (cFiles == 1)
  33.       {
  34. !     if (mch_isdir(fnames[0]))
  35.       {
  36. !         if (mch_chdir(fnames[0]) == 0)
  37. !         {
  38. !         vim_free(fnames[0]);
  39. !         fnames[0] = NULL;
  40. !         redo_dirs = TRUE;
  41. !         }
  42.       }
  43.       }
  44.   
  45.       DragFinish(hDrop);
  46.   
  47. !     if (GetKeyState(VK_SHIFT) & 0x8000)
  48.       {
  49.       /* Shift held down, change to first file's directory */
  50. !     if (vim_chdirfile(fnames[0]) == 0)
  51. !         redo_dirs = TRUE;
  52. !     }
  53.   
  54. !     /* Handle the drop, :edit or :split to get to the file */
  55. !     handle_drop(cFiles, fnames, ((GetKeyState(VK_CONTROL) & 0x8000) != 0));
  56.   
  57.       if (redo_dirs)
  58.       shorten_fnames();
  59. --- 669,699 ----
  60.   
  61.       /*
  62.        * Handle dropping a directory on Vim.
  63. +      * Change to that directory and don't open any file.
  64.        */
  65. !     if (cFiles == 1 && mch_isdir(fnames[0]))
  66.       {
  67. !     if (mch_chdir(fnames[0]) == 0)
  68.       {
  69. !         smsg((char_u *)":cd %s", fnames[0]);
  70. !         vim_free(fnames[0]);
  71. !         fnames[0] = NULL;
  72. !         redo_dirs = TRUE;
  73.       }
  74.       }
  75.   
  76.       DragFinish(hDrop);
  77.   
  78. !     if (fnames[0] != NULL)
  79.       {
  80.       /* Shift held down, change to first file's directory */
  81. !     if (GetKeyState(VK_SHIFT) & 0x8000)
  82. !         if (vim_chdirfile(fnames[0]) == 0)
  83. !         redo_dirs = TRUE;
  84.   
  85. !     /* Handle the drop, :edit or :split to get to the file */
  86. !     handle_drop(cFiles, fnames, ((GetKeyState(VK_CONTROL) & 0x8000) != 0));
  87. !     }
  88.   
  89.       if (redo_dirs)
  90.       shorten_fnames();
  91.  
  92. --
  93. hundred-and-one symptoms of being an internet addict:
  94. 73. You give your dog used motherboards instead of bones
  95.  
  96. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  97.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  98.