From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel,gmane.emacs.sources Subject: Re: Fix for Emacs Crash Date: 07 Nov 2002 19:47:57 +0000 Sender: emacs-devel-admin@gnu.org Message-ID: References: <002101c28612$e1e15710$6501a8c0@GODDESS> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1036700208 13701 80.91.224.249 (7 Nov 2002 20:16:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 7 Nov 2002 20:16:48 +0000 (UTC) Cc: "Emacs-Devel (E-mail)" , "Gnu-Emacs-Sources (E-mail)" Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 189t54-0003Yo-00 for ; Thu, 07 Nov 2002 21:16:46 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 189tEC-0001D2-00 for ; Thu, 07 Nov 2002 21:26:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 189t4N-0005ce-00; Thu, 07 Nov 2002 15:16:03 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 189sqq-0000sF-00 for emacs-devel@gnu.org; Thu, 07 Nov 2002 15:02:04 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 189sqn-0000rX-00 for emacs-devel@gnu.org; Thu, 07 Nov 2002 15:02:03 -0500 Original-Received: from rhenium.btinternet.com ([194.73.73.93] helo=rhenium) by monty-python.gnu.org with esmtp (Exim 4.10) id 189sqn-0000r5-00; Thu, 07 Nov 2002 15:02:01 -0500 Original-Received: from host62-7-117-2.in-addr.btopenworld.com ([62.7.117.2] helo=nyaumo.btinternet.com) by rhenium with esmtp (Exim 3.22 #15) id 189sqk-0003Cm-00; Thu, 07 Nov 2002 20:01:59 +0000 Original-Received: from nyaumo.btinternet.com (nyaumo.btinternet.com [127.0.0.1]) by nyaumo.btinternet.com (Postfix) with ESMTP id 696954B126; Thu, 7 Nov 2002 19:47:58 +0000 (GMT) Original-To: In-Reply-To: <002101c28612$e1e15710$6501a8c0@GODDESS> Original-Lines: 32 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9237 gmane.emacs.sources:205 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9237 "Ben Key" writes: > + set_menu_item_info ( > + menu, > + item != NULL ? (UINT) item : (UINT) wv->call_data, > + item != NULL ? FALSE : TRUE, > + &info); > * I interpreted the line > item != NULL ? (UINT) item : (UINT) wv->call_data, > to mean if item is not NULL, use the specified menu identifier, otherwise > use the position specified by the call_data member of the wv structure. I don't think call_data specifies a position, but it may be by chance that things work correctly in many cases where item == NULL by assuming it does. You will have to figure out what wv->call_data and item represent by studying the rest of the code. My memory is sketchy, but I think that item can be NULL for menu titles and separator lines. In the title case, wv->call_data might be NULL as well, so your modified code does the right thing even though the assumptions behind it are wrong, since titles are at position 0. But I am not sure what happens in the separator case. > * Based upon this interpretation, passing SetMenuItemInfo a value of FALSE > for the fByPosition parameter unconditionally is obviously incorrect. > Instead fByPosition should only be FALSE if item is non NULL. I think this part of your interpretation is correct. Thanks for tracking this down.