To: vim-dev@vim.org Subject: patch 5.5.052 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.5.052 Problem: Crash when using a cursor key at the ATTENTION prompt. (Alberani) Solution: Ignore special keys at the console dialog. Also ignore characters > 255 for other uses of tolower() and toupper(). Files: src/menu.c, src/message.c, src/misc2.c *** ../vim-5.5.51/src/menu.c Sat Dec 4 13:59:43 1999 --- src/menu.c Sat Dec 4 19:56:07 1999 *************** *** 1348,1356 **** { VimMenu *menu; ! key = TO_LOWER(key); for (menu = root_menu; menu != NULL; menu = menu->next) ! if (TO_LOWER(menu->mnemonic) == key) return TRUE; return FALSE; } --- 1348,1358 ---- { VimMenu *menu; ! if (key < 256) ! key = TO_LOWER(key); for (menu = root_menu; menu != NULL; menu = menu->next) ! if (menu->mnemonic == key ! || (menu->mnemonic < 256 && TO_LOWER(menu->mnemonic) == key)) return TRUE; return FALSE; } *** ../vim-5.5.51/src/message.c Wed Sep 22 10:06:29 1999 --- src/message.c Thu Dec 2 21:26:00 1999 *************** *** 1711,1716 **** --- 1711,1718 ---- retval = 0; break; default: /* Could be a hotkey? */ + if (c > 255) /* special keys are ignored here */ + continue; for (retval = 0; hotkeys[retval]; retval++) { if (hotkeys[retval] == TO_LOWER(c)) *** ../vim-5.5.51/src/misc2.c Wed Sep 22 10:06:23 1999 --- src/misc2.c Sat Dec 4 19:59:30 1999 *************** *** 1472,1480 **** { int i; ! for (i = 0; mod_mask_table[i].mod_mask; i++) ! if (TO_LOWER(c) == TO_LOWER(mod_mask_table[i].name)) ! return mod_mask_table[i].mod_mask; return 0x0; } --- 1472,1483 ---- { int i; ! if (c <= 255) /* avoid TO_LOWER() with number > 255 */ ! { ! for (i = 0; mod_mask_table[i].mod_mask; i++) ! if (TO_LOWER(c) == TO_LOWER(mod_mask_table[i].name)) ! return mod_mask_table[i].mod_mask; ! } return 0x0; } *** ../vim-5.5.51/src/version.c Sat Dec 4 15:05:59 1999 --- src/version.c Sat Dec 4 20:10:37 1999 *************** *** 420,420 **** --- 420,421 ---- { /* Add new patch number below this line */ + 52, -- You can tune a file system, but you can't tuna fish -- man tunefs --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\-- \ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /