From 867cc23e444dd4fd25717f8df280b03718b99907 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 8 Aug 2006 09:33:10 +0000 Subject: [PATCH] * etags.c (TEX_mode): Check getc retruns EOF. File ended without newline causes infinite loop. --- lib-src/ChangeLog | 5 +++++ lib-src/etags.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index f61188fb8d5..84b15459322 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-07 Masatake YAMATO + + * etags.c (TEX_mode): Check getc retruns EOF. + File ended without newline causes infinite loop. + 2002-07-30 Adrian Aichner (tiny change) * etags.c: It's XEmacs, not Xemacs: change all the occurences. diff --git a/lib-src/etags.c b/lib-src/etags.c index d60c12c2bcc..d455ddc276d 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -5165,7 +5165,7 @@ TEX_mode (inf) { /* 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; -- 2.39.2