unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fix infinite loop in tex file handling in etags
@ 2006-08-07  4:01 Masatake YAMATO
  2006-08-08  9:33 ` Jan Djärv
  0 siblings, 1 reply; 6+ messages in thread
From: Masatake YAMATO @ 2006-08-07  4:01 UTC (permalink / raw)


Could someone install this patch, too?

2006-08-07  Masatake YAMATO  <jet@gyve.org>

	* 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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix infinite loop in tex file handling in etags
  2006-08-07  4:01 Fix infinite loop in tex file handling in etags Masatake YAMATO
@ 2006-08-08  9:33 ` Jan Djärv
  2006-08-12 13:46   ` Francesco Potorti
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Djärv @ 2006-08-08  9:33 UTC (permalink / raw)
  Cc: emacs-devel



Masatake YAMATO skrev:
> Could someone install this patch, too?
> 

Done.

	Jan D.

> 2006-08-07  Masatake YAMATO  <jet@gyve.org>
> 
> 	* 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;
> 
> 
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix infinite loop in tex file handling in etags
  2006-08-08  9:33 ` Jan Djärv
@ 2006-08-12 13:46   ` Francesco Potorti
  2006-08-12 14:24     ` Jan D.
  2006-08-14  8:35     ` Masatake YAMATO
  0 siblings, 2 replies; 6+ messages in thread
From: Francesco Potorti @ 2006-08-12 13:46 UTC (permalink / raw)
  Cc: Masatake YAMATO, emacs-devel

>> Could someone install this patch, too?
>
>Done.

Please, do not install changes in etags.c, unless it is urgent and the
reasons for the changes are clearly understood.  Generally speaking, it
is better asking me first, as I have a regression test suite that I run
before committing any changes.

I am going to examine the changes you made.  In the meantime, would you
please send me a test case showing that etags fails for each of your
changes?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix infinite loop in tex file handling in etags
  2006-08-12 13:46   ` Francesco Potorti
@ 2006-08-12 14:24     ` Jan D.
  2006-08-14  8:35     ` Masatake YAMATO
  1 sibling, 0 replies; 6+ messages in thread
From: Jan D. @ 2006-08-12 14:24 UTC (permalink / raw)
  Cc: Masatake YAMATO, emacs-devel

Francesco Potorti wrote:
>>> Could someone install this patch, too?
>>>       
>> Done.
>>     
>
> Please, do not install changes in etags.c, unless it is urgent and the
> reasons for the changes are clearly understood.  Generally speaking, it
> is better asking me first, as I have a regression test suite that I run
> before committing any changes.
>   

Ok.

> I am going to examine the changes you made.  In the meantime, would you
> please send me a test case showing that etags fails for each of your
> changes?

The first change (important that the file x.tex does not end in a newline):
% echo -n "%" > x.tex
% etags x.tex

etags hangs in an infinite loop.

The second change:
% echo '#line 123 L"x.c"' > x.c
% etags x.c

etags gets a segmentation violation.

    Jan D.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix infinite loop in tex file handling in etags
  2006-08-12 13:46   ` Francesco Potorti
  2006-08-12 14:24     ` Jan D.
@ 2006-08-14  8:35     ` Masatake YAMATO
  2006-08-14 14:29       ` Francesco Potorti
  1 sibling, 1 reply; 6+ messages in thread
From: Masatake YAMATO @ 2006-08-14  8:35 UTC (permalink / raw)
  Cc: emacs-devel

> >> Could someone install this patch, too?
> >
> >Done.
> 
> Please, do not install changes in etags.c, unless it is urgent and the
> reasons for the changes are clearly understood.  Generally speaking, it
> is better asking me first, as I have a regression test suite that I run
> before committing any changes.

How about etags.1?

2006-08-14  Masatake YAMATO  <jet@gyve.org>

	* etags.1: Added / to the end of DEVAR regex evamle.

--- etags.1	01  7月 2006 12:53:00 +0900	3.22
+++ etags.1	14  8月 2006 09:22:59 +0900	
@@ -205,7 +205,7 @@
 
 Tag the DEFVAR macros in the emacs source files:
 .br
-\fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP
+\fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"/'\fP
 .\"" This comment is to avoid confusion to Emacs syntax highlighting
 .br

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Fix infinite loop in tex file handling in etags
  2006-08-14  8:35     ` Masatake YAMATO
@ 2006-08-14 14:29       ` Francesco Potorti
  0 siblings, 0 replies; 6+ messages in thread
From: Francesco Potorti @ 2006-08-14 14:29 UTC (permalink / raw)
  Cc: emacs-devel

>How about etags.1?
>
>2006-08-14  Masatake YAMATO  <jet@gyve.org>
>
>	* etags.1: Added / to the end of DEVAR regex evamle.
>
>--- etags.1	01  7月 2006 12:53:00 +0900	3.22
>+++ etags.1	14  8月 2006 09:22:59 +0900	
>@@ -205,7 +205,7 @@
> 
> Tag the DEFVAR macros in the emacs source files:
> .br
>-\fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"\/'\fP
>+\fI\-\-regex\='/[ \\t]*DEFVAR_[A-Z_ \\t(]+"\\([^"]+\\)"/'\fP
> .\"" This comment is to avoid confusion to Emacs syntax highlighting
> .br

Ok, thank you.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-08-14 14:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-07  4:01 Fix infinite loop in tex file handling in etags Masatake YAMATO
2006-08-08  9:33 ` Jan Djärv
2006-08-12 13:46   ` Francesco Potorti
2006-08-12 14:24     ` Jan D.
2006-08-14  8:35     ` Masatake YAMATO
2006-08-14 14:29       ` Francesco Potorti

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).