changeset 72328:bf72b454a40d

(readline): Change position on %n and \" in sscanf.
author Jan Djärv <jan.h.d@swipnet.se>
date Wed, 09 Aug 2006 06:56:16 +0000
parents 1fb4cb2b0ce0
children 43638213c829
files lib-src/ChangeLog lib-src/etags.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Wed Aug 09 06:22:27 2006 +0000
+++ b/lib-src/ChangeLog	Wed Aug 09 06:56:16 2006 +0000
@@ -1,6 +1,7 @@
 2006-08-09  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* etags.c (readline): expect sscanf returns >= 1.
+	(readline): Change position on %n and \" in sscanf.
 
 2006-08-07  Masatake YAMATO  <jet@gyve.org>
 
--- a/lib-src/etags.c	Wed Aug 09 06:22:27 2006 +0000
+++ b/lib-src/etags.c	Wed Aug 09 06:56:16 2006 +0000
@@ -6259,9 +6259,10 @@
 	  int start, lno;
 
 	  if (DEBUG) start = 0;	/* shut up the compiler */
-	  if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) >= 1)
+	  if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1
+	      && inp[start] == '"')
 	    {
-	      char *endp = lbp->buffer + start;
+	      char *endp = lbp->buffer + ++start;
 
 	      assert (start > 0);
 	      while ((endp = etags_strchr (endp, '"')) != NULL