# HG changeset patch # User Francesco Potort # Date 1164721236 0 # Node ID e3d189507be0651840bc43d3b3fa9757bb9564ec # Parent bb13d8a89b11d17bbc33209c1235bfd0703bd249 Previous changes checked in by jhd checked and cleaned up: (readline): Check for double quote after #line. (readline): sscanf could in principle return 2. (TeX_commands): Use p++ (rather than *p++) to increment p. (Lua_functions): Explicitely discard LOOKING_AT's return value. (TEX_mode): Check getc retruns EOF. File ended without newline causes infinite loop. diff -r bb13d8a89b11 -r e3d189507be0 lib-src/etags.c --- a/lib-src/etags.c Tue Nov 28 13:31:27 2006 +0000 +++ b/lib-src/etags.c Tue Nov 28 13:40:36 2006 +0000 @@ -41,7 +41,7 @@ * configuration file containing regexp definitions for etags. */ -char pot_etags_version[] = "@(#) pot revision number is 17.20"; +char pot_etags_version[] = "@(#) pot revision number is $Revision: 17.22 $"; #define TRUE 1 #define FALSE 0 @@ -4955,7 +4955,7 @@ if (bp[0] != 'f' && bp[0] != 'l') continue; - LOOKING_AT (bp, "local"); /* skip possible "local" */ + (void)LOOKING_AT (bp, "local"); /* skip possible "local" */ if (LOOKING_AT (bp, "function")) get_tag (bp, NULL); @@ -5137,7 +5137,7 @@ if (!opgrp || *p == TEX_clgrp) { while (*p != '\0' && *p != TEX_opgrp && *p != TEX_clgrp) - *p++; + p++; linelen = p - lb.buffer + 1; } make_tag (cp, namelen, TRUE, @@ -6256,15 +6256,14 @@ /* Check whether this is a #line directive. */ if (result > 12 && strneq (lbp->buffer, "#line ", 6)) { - int start, lno; - - if (DEBUG) start = 0; /* shut up the compiler */ - if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1 - && lbp->buffer[start] == '"') + unsigned int lno; + int start = 0; + + if (sscanf (lbp->buffer, "#line %u \"%n", &lno, &start) >= 1 + && start > 0) /* double quote character found */ { - char *endp = lbp->buffer + ++start; - - assert (start > 0); + char *endp = lbp->buffer + start; + while ((endp = etags_strchr (endp, '"')) != NULL && endp[-1] == '\\') endp++;