# HG changeset patch # User Andrew Choi # Date 1033963207 0 # Node ID af8ff2a92902d40c4a66965a62a0797063e521ed # Parent 6a7ae10d9c9639b1dabc6bcfc2f884caecce0015 2002-10-06 Andrew Choi * macmenu.c (mac_menu_show): Add j to count menu items; match menu_item_selection to it to find selected item. diff -r 6a7ae10d9c96 -r af8ff2a92902 src/ChangeLog --- a/src/ChangeLog Sun Oct 06 21:34:07 2002 +0000 +++ b/src/ChangeLog Mon Oct 07 04:00:07 2002 +0000 @@ -1,3 +1,8 @@ +2002-10-06 Andrew Choi + + * macmenu.c (mac_menu_show): Add j to count menu items; match + menu_item_selection to it to find selected item. + 2002-10-06 Jan D. * xterm.c (XTread_socket): Fix from 2002-10-03 didn't cover all diff -r 6a7ae10d9c96 -r af8ff2a92902 src/macmenu.c --- a/src/macmenu.c Sun Oct 06 21:34:07 2002 +0000 +++ b/src/macmenu.c Mon Oct 07 04:00:07 2002 +0000 @@ -1839,6 +1839,7 @@ if (menu_item_selection != 0) { Lisp_Object prefix, entry; + int j = 1; prefix = entry = Qnil; i = 0; @@ -1860,6 +1861,7 @@ prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; i += MENU_ITEMS_PANE_LENGTH; + j += 2; } /* Ignore a nil in the item list. It's meaningful only for dialog boxes. */ @@ -1869,7 +1871,7 @@ { entry = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_VALUE]; - if (menu_item_selection == i) + if (menu_item_selection == j) { if (keymaps != 0) { @@ -1885,6 +1887,7 @@ return entry; } i += MENU_ITEMS_ITEM_LENGTH; + j++; } } }