To: "Demirel, Kayhan" In-Reply-To: <2BC52EF1968FD211B3AB00805FE6FE82014F602B@uspalx21.pal.sap-ag.de> Subject: patch 5.4.x3 (was: vim 5.4 crash under NT) Fcc: outbox From: Bram Moolenaar ------------ Kayhan Demirel wrote: > When I drag a directory (and not a file) on gvim 5.4 (-u NONE -U NONE) > it crashes ... (NT 4 Workstation using nt explorer) I can reproduce it, also on Windows 98. It appears that a NULL pointer is used when trying to open the directory as a file. That needs to be fixed. Patch 5.4.x3 Problem: Win32 GUI: When dropping a directory on a running gvim it crashes. Solution: Avoid using a NULL file name. Also display a message to indicate that the current directory was changed. Files: src/gui_w32.c *** ../vim-5.4.24/src/gui_w32.c Tue Aug 10 16:11:57 1999 --- src/gui_w32.c Fri Aug 13 11:50:26 1999 *************** *** 669,699 **** /* * Handle dropping a directory on Vim. */ ! if (cFiles == 1) { ! if (mch_isdir(fnames[0])) { ! if (mch_chdir(fnames[0]) == 0) ! { ! vim_free(fnames[0]); ! fnames[0] = NULL; ! redo_dirs = TRUE; ! } } } DragFinish(hDrop); ! if (GetKeyState(VK_SHIFT) & 0x8000) { /* Shift held down, change to first file's directory */ ! if (vim_chdirfile(fnames[0]) == 0) ! redo_dirs = TRUE; ! } ! /* Handle the drop, :edit or :split to get to the file */ ! handle_drop(cFiles, fnames, ((GetKeyState(VK_CONTROL) & 0x8000) != 0)); if (redo_dirs) shorten_fnames(); --- 669,699 ---- /* * Handle dropping a directory on Vim. + * Change to that directory and don't open any file. */ ! if (cFiles == 1 && mch_isdir(fnames[0])) { ! if (mch_chdir(fnames[0]) == 0) { ! smsg((char_u *)":cd %s", fnames[0]); ! vim_free(fnames[0]); ! fnames[0] = NULL; ! redo_dirs = TRUE; } } DragFinish(hDrop); ! if (fnames[0] != NULL) { /* Shift held down, change to first file's directory */ ! if (GetKeyState(VK_SHIFT) & 0x8000) ! if (vim_chdirfile(fnames[0]) == 0) ! redo_dirs = TRUE; ! /* Handle the drop, :edit or :split to get to the file */ ! handle_drop(cFiles, fnames, ((GetKeyState(VK_CONTROL) & 0x8000) != 0)); ! } if (redo_dirs) shorten_fnames(); -- hundred-and-one symptoms of being an internet addict: 73. You give your dog used motherboards instead of bones --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /