unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [RFC] etags ada parser: doesn't stop when giving broken input
@ 2013-04-08  8:18 Masatake YAMATO
  2013-04-09  9:00 ` Stephen Leake
  0 siblings, 1 reply; 4+ messages in thread
From: Masatake YAMATO @ 2013-04-08  8:18 UTC (permalink / raw)
  To: emacs-devel

Look at following bug reproducer:

    % cat /tmp/a.adb
    cat /tmp/a.adb
    ~

    # Make TAGS file with the original version
    % /usr/bin/etags /tmp/a.adb 
    /usr/bin/etags /tmp/a.adb 
    #  Doen't stop C-c C-c^C

    # Patched version
    % ./etags /tmp/a.adb 
    ./etags /tmp/a.adb 
    % LC_ALL=C ls -l TAGS
    -rw-rw-r--. 1 yamato yamato 15 Apr  8 17:09 TAGS

I expect etags stops even if broken input is given.
I wrote a small patch. However, I'm not sure this is correct fix.
Someone who knows both ada and etags, could you review this patch?

    
2013-04-08  Masatake YAMATO  <yamato@redhat.com>

	* etags.c (Ada_funcs): Advance dbp before checking
	input with endtoken.

=== modified file 'lib-src/etags.c'
*** lib-src/etags.c	2013-03-13 07:27:34 +0000
--- lib-src/etags.c	2013-04-08 08:06:37 +0000
***************
*** 4231,4238 ****
  	    }
  
  	  /* Look for the end of the token. */
! 	  while (!endtoken (*dbp))
  	    dbp++;
  
  	} /* advance char */
      } /* advance line */
--- 4231,4239 ----
  	    }
  
  	  /* Look for the end of the token. */
! 	  do
  	    dbp++;
+ 	  while (!endtoken (*dbp));
  
  	} /* advance char */
      } /* advance line */




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

end of thread, other threads:[~2013-04-10  0:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-08  8:18 [RFC] etags ada parser: doesn't stop when giving broken input Masatake YAMATO
2013-04-09  9:00 ` Stephen Leake
2013-04-09 21:05   ` Francesco Potortì
2013-04-10  0:36     ` Stefan Monnier

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).