From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.devel Subject: [RFC] etags ada parser: doesn't stop when giving broken input Date: Mon, 08 Apr 2013 17:18:44 +0900 (JST) Organization: Red Hat Japan, Inc. Message-ID: <20130408.171844.1201396057660785985.yamato@redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1365445628 3548 80.91.229.3 (8 Apr 2013 18:27:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Apr 2013 18:27:08 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 08 20:27:12 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UPGmS-0004Y8-W0 for ged-emacs-devel@m.gmane.org; Mon, 08 Apr 2013 20:27:01 +0200 Original-Received: from localhost ([::1]:36647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7IB-00064u-5r for ged-emacs-devel@m.gmane.org; Mon, 08 Apr 2013 04:19:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55291) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7I2-0005vS-F1 for emacs-devel@gnu.org; Mon, 08 Apr 2013 04:19:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UP7Hs-0002I1-R7 for emacs-devel@gnu.org; Mon, 08 Apr 2013 04:18:58 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:27303) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UP7Hs-0002Hp-JB for emacs-devel@gnu.org; Mon, 08 Apr 2013 04:18:48 -0400 Original-Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r388IjPF017287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Apr 2013 04:18:46 -0400 Original-Received: from localhost (dhcp-193-108.nrt.redhat.com [10.64.193.108]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r388Ii1K020450 for ; Mon, 8 Apr 2013 04:18:45 -0400 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158767 Archived-At: Look at following bug reproducer: % cat /tmp/a.adb cat /tmp/a.adb ~ # Make TAGS file with the original version % /usr/bin/etags /tmp/a.adb /usr/bin/etags /tmp/a.adb # Doen't stop C-c C-c^C # Patched version % ./etags /tmp/a.adb ./etags /tmp/a.adb % LC_ALL=C ls -l TAGS -rw-rw-r--. 1 yamato yamato 15 Apr 8 17:09 TAGS I expect etags stops even if broken input is given. I wrote a small patch. However, I'm not sure this is correct fix. Someone who knows both ada and etags, could you review this patch? 2013-04-08 Masatake YAMATO * etags.c (Ada_funcs): Advance dbp before checking input with endtoken. === modified file 'lib-src/etags.c' *** lib-src/etags.c 2013-03-13 07:27:34 +0000 --- lib-src/etags.c 2013-04-08 08:06:37 +0000 *************** *** 4231,4238 **** } /* Look for the end of the token. */ ! while (!endtoken (*dbp)) dbp++; } /* advance char */ } /* advance line */ --- 4231,4239 ---- } /* Look for the end of the token. */ ! do dbp++; + while (!endtoken (*dbp)); } /* advance char */ } /* advance line */