unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Masatake YAMATO <yamato@redhat.com>
To: emacs-devel@gnu.org
Subject: [RFC] etags ada parser: doesn't stop when giving broken input
Date: Mon, 08 Apr 2013 17:18:44 +0900 (JST)	[thread overview]
Message-ID: <20130408.171844.1201396057660785985.yamato@redhat.com> (raw)

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




             reply	other threads:[~2013-04-08  8:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-08  8:18 Masatake YAMATO [this message]
2013-04-09  9:00 ` [RFC] etags ada parser: doesn't stop when giving broken input Stephen Leake
2013-04-09 21:05   ` Francesco Potortì
2013-04-10  0:36     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130408.171844.1201396057660785985.yamato@redhat.com \
    --to=yamato@redhat.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).