emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC] etags ada parser: doesn't stop when giving broken input


From: Masatake YAMATO
Subject: [RFC] etags ada parser: doesn't stop when giving broken input
Date: Mon, 08 Apr 2013 17:18:44 +0900 (JST)

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  <address@hidden>

        * 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 via email to

[Prev in Thread] Current Thread [Next in Thread]