From f2377634eeb3fab625da2bb56b6abd10bfa5580e Mon Sep 17 00:00:00 2001 From: ericm Date: Tue, 27 Jun 2000 17:15:58 +0000 Subject: * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from [Bug: 5275], which corrected a segfault-causing indexing problem when deleting entries from torn-off menus. FossilOrigin-Name: 8af6cddde88be1ca677ac188fbd7e0043b2eb482 --- ChangeLog | 6 ++++++ generic/tkMenu.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7d2a52..2bea01a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-06-27 Eric Melski + + * generic/tkMenu.c (DeleteMenuCloneEntries): Applied fix from + [Bug: 5275], which corrected a segfault-causing indexing problem + when deleting entries from torn-off menus. + 2000-06-22 Eric Melski * doc/getOpenFile.n: Updated with information about -multiple. diff --git a/generic/tkMenu.c b/generic/tkMenu.c index b3f906d..89525ed 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.6 2000/02/10 08:52:35 hobbs Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.7 2000/06/27 17:15:58 ericm Exp $ */ /* @@ -3403,7 +3403,7 @@ DeleteMenuCloneEntries(menuPtr, first, last) } for (i = last + 1; i < menuListPtr->numEntries; i++) { menuListPtr->entries[i - numDeleted] = menuListPtr->entries[i]; - menuListPtr->entries[i - numDeleted]->index = i; + menuListPtr->entries[i - numDeleted]->index = i - numDeleted; } menuListPtr->numEntries -= numDeleted; if (menuListPtr->numEntries == 0) { -- cgit v0.12