summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì <pot@gnu.org>2006-11-28 13:40:36 +0000
committerFrancesco Potortì <pot@gnu.org>2006-11-28 13:40:36 +0000
commit21cb180b3029f7c24ee5bb3b22c25c8e6cad9675 (patch)
tree43a6aa759c4b905ba115f0979438a7bbae982d7f /lib-src
parentbae1fc0b339223ee994dd57a1e00ba62aca25da9 (diff)
downloademacs-21cb180b3029f7c24ee5bb3b22c25c8e6cad9675.tar.gz
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.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 49a18be1df5..c3578a4b1ad 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -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 @@ Lua_functions (inf)
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 @@ TeX_commands (inf)
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 @@ readline (lbp, stream)
/* Check whether this is a #line directive. */
if (result > 12 && strneq (lbp->buffer, "#line ", 6))
{
- int start, lno;
+ unsigned int lno;
+ int start = 0;
- if (DEBUG) start = 0; /* shut up the compiler */
- if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1
- && lbp->buffer[start] == '"')
+ if (sscanf (lbp->buffer, "#line %u \"%n", &lno, &start) >= 1
+ && start > 0) /* double quote character found */
{
- char *endp = lbp->buffer + ++start;
+ char *endp = lbp->buffer + start;
- assert (start > 0);
while ((endp = etags_strchr (endp, '"')) != NULL
&& endp[-1] == '\\')
endp++;