changeset 72314:b0755f0706c2

* etags.c (TEX_mode): Check getc retruns EOF. File ended without newline causes infinite loop.
author Jan Djärv <jan.h.d@swipnet.se>
date Tue, 08 Aug 2006 09:33:10 +0000
parents 01a5a5e2cfb0
children 95367ca0bf96
files lib-src/ChangeLog lib-src/etags.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Tue Aug 08 08:06:08 2006 +0000
+++ b/lib-src/ChangeLog	Tue Aug 08 09:33:10 2006 +0000
@@ -1,3 +1,8 @@
+2006-08-07  Masatake YAMATO  <jet@gyve.org>
+
+	* etags.c (TEX_mode): Check getc retruns EOF.
+	File ended without newline causes infinite loop.
+
 2002-07-30  Adrian Aichner  <adrian@xemacs.org>  (tiny change)
 
 	* etags.c: It's XEmacs, not Xemacs: change all the occurences.
--- a/lib-src/etags.c	Tue Aug 08 08:06:08 2006 +0000
+++ b/lib-src/etags.c	Tue Aug 08 09:33:10 2006 +0000
@@ -5165,7 +5165,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;