]> code.delx.au - gnu-emacs/commitdiff
* etags.c (TEX_mode): Check getc retruns EOF.
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 8 Aug 2006 09:33:10 +0000 (09:33 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 8 Aug 2006 09:33:10 +0000 (09:33 +0000)
 File ended without newline causes infinite loop.

lib-src/ChangeLog
lib-src/etags.c

index f61188fb8d55ebd1743f5661705463aa888e6631..84b154593222ab889470677b4a8880cdd0c3cf7d 100644 (file)
@@ -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.
index d60c12c2bcc367c9fa33b20785a4feb376d3c3fa..d455ddc276d6fce27e9554e5a53ad0cb76c47882 100644 (file)
@@ -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;