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: Fix infinite loop in tex file handling in etags Date: Mon, 07 Aug 2006 13:01:10 +0900 (JST) Message-ID: <20060807.130110.80242582.jet@gyve.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1154923329 21910 80.91.229.2 (7 Aug 2006 04:02:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Aug 2006 04:02:09 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 07 06:02:08 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G9wJG-0003L7-9c for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2006 06:01:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G9wJF-0003M5-IX for ged-emacs-devel@m.gmane.org; Mon, 07 Aug 2006 00:01:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G9wJ1-0003J9-Ri for emacs-devel@gnu.org; Mon, 07 Aug 2006 00:01:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G9wJ0-0003GN-A6 for emacs-devel@gnu.org; Mon, 07 Aug 2006 00:01:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G9wJ0-0003G6-5Z for emacs-devel@gnu.org; Mon, 07 Aug 2006 00:01:30 -0400 Original-Received: from [66.187.233.31] (helo=mx1.redhat.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G9wN9-0007Nf-BQ for emacs-devel@gnu.org; Mon, 07 Aug 2006 00:05:47 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k7741ThC020537 for ; Mon, 7 Aug 2006 00:01:29 -0400 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k7741Mxn000984 for ; Mon, 7 Aug 2006 00:01:23 -0400 Original-Received: from localhost (dhcp98.tokyo.redhat.com [172.16.33.98]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id k7741MWx021677 for ; Mon, 7 Aug 2006 13:01:22 +0900 Original-To: emacs-devel@gnu.org X-Mailer: Mew version 4.2.53 on Emacs 22.0.51 / Mule 5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:58154 Archived-At: Could someone install this patch, too? 2006-08-07 Masatake YAMATO * etags.c (TEX_mode): Check getc retruns EOF. File ended without newline causes infinite loop. --- orig/lib-src/etags.c +++ mod/lib-src/etags.c @@ -5198,7 +5198,7 @@ { /* Skip to next line if we hit the TeX comment char. */ if (c == '%') - while (c != '\n') + while (c != '\n' && c != EOF) c = getc (inf); else if (c == TEX_LESC || c == TEX_SESC ) break;