From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#5601: 23.1; etags Scheme_functions past \0 terminator Date: Fri, 19 Feb 2010 10:39:34 +0100 Message-ID: References: <87eikiaxqf.fsf@blah.blah> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1266578800 3958 80.91.229.12 (19 Feb 2010 11:26:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Feb 2010 11:26:40 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, owner@debbugs.gnu.org, 5601@debbugs.gnu.org To: Kevin Ryde Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 19 12:26:36 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NiR0F-0006vw-6L for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Feb 2010 12:26:35 +0100 Original-Received: from localhost ([127.0.0.1]:35271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiR0E-0003yv-GA for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Feb 2010 06:26:34 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NiQwn-0001yY-CW for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 06:23:01 -0500 Original-Received: from [140.186.70.92] (port=52672 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NiQwi-0001vh-3t for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 06:23:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NiQwg-0007KT-EE for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 06:22:55 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42304) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiQwg-0007KO-BA for bug-gnu-emacs@gnu.org; Fri, 19 Feb 2010 06:22:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NiQlE-0000QG-CB; Fri, 19 Feb 2010 06:11:04 -0500 X-Loop: bug-gnu-emacs@gnu.org Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 19 Feb 2010 11:11:04 +0000 Resent-Message-ID: Resent-Sender: bug-gnu-emacs@gnu.org X-Emacs-PR-Message: followup 5601 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5601-submit@debbugs.gnu.org id=B5601.12665778471589 (code B ref 5601); Fri, 19 Feb 2010 11:11:04 +0000 Original-Received: (at 5601) by debbugs.gnu.org; 19 Feb 2010 11:10:47 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiQkv-0000PV-DV for submit@debbugs.gnu.org; Fri, 19 Feb 2010 06:10:45 -0500 Original-Received: from blade3.isti.cnr.it ([194.119.192.19]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NiPLp-0007tT-Hw; Fri, 19 Feb 2010 04:40:57 -0500 Original-Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.5-b2 #31825) id <01NJUE2L3FSGBF2BYI@mx.isti.cnr.it>; Fri, 19 Feb 2010 10:39:35 +0100 Original-Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.5-b2 #31826) with ESMTPSA id <01NJUE2JJWFSBJSE3W@mx.isti.cnr.it>; Fri, 19 Feb 2010 10:39:32 +0100 (MET) Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.71) (envelope-from ) id 1NiPKg-0000oy-3Q; Fri, 19 Feb 2010 10:39:34 +0100 In-reply-to: <87eikiaxqf.fsf@blah.blah> X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-Mailman-Approved-At: Fri, 19 Feb 2010 06:10:41 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 19 Feb 2010 06:11:04 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35194 Archived-At: >In etags.c Scheme_functions, I think the loop > > while (notinname (*bp)) > bp++; > >will take bp past the '\0' string terminator, because '\0' is a >notinname(). Yes, it appears so. This is a long-standing bug. Thanks for spotting it. >(Another helper skip_notinname() to try to be clearer >than a double-negative loop :-) I don't think a helper function is granted here. There is a single use of this construct in the file, and a lot of different constructs: we have not a helper function for each of them. Let's try to stick to the comomn ones only, else we will only add to the confusion. So, please do not define a helper function for this case. Again, I can do the change myself, or else you can do it yourself, as you like. >2010-02-19 Kevin Ryde > > * etags.c (Scheme_functions): Don't go past '\0' terminator. > (skip_notinname): New helper. > >--- etags.c.~3.93.~ 2009-11-29 08:42:32.000000000 +1100 >+++ etags.c 2010-02-19 11:04:42.000000000 +1100 >@@ -4989,6 +4989,16 @@ > * (set! xyzzy > * Original code by Ken Haase (1985?) > */ >+ >+static char * >+skip_notinname (char *cp) >+{ >+ /* '\0' is a notinname(), don't continue past it */ >+ while (*cp && notinname (*cp)) >+ cp++; >+ return cp; >+} >+ > static void > Scheme_functions (inf) > FILE *inf; >@@ -5001,8 +5011,7 @@ > { > bp = skip_non_spaces (bp+4); > /* Skip over open parens and white space */ >- while (notinname (*bp)) >- bp++; >+ bp = skip_notinname (bp); > get_tag (bp, NULL); > } > if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!")) > > > >In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) > of 2009-09-14 on raven, modified by Debian >configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''