aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorFrancesco Potortì2006-11-28 13:40:36 +0000
committerFrancesco Potortì2006-11-28 13:40:36 +0000
commit21cb180b3029f7c24ee5bb3b22c25c8e6cad9675 (patch)
tree43a6aa759c4b905ba115f0979438a7bbae982d7f /lib-src
parentbae1fc0b339223ee994dd57a1e00ba62aca25da9 (diff)
downloademacs-21cb180b3029f7c24ee5bb3b22c25c8e6cad9675.tar.gz
emacs-21cb180b3029f7c24ee5bb3b22c25c8e6cad9675.zip
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 @@
41 * configuration file containing regexp definitions for etags. 41 * configuration file containing regexp definitions for etags.
42 */ 42 */
43 43
44char pot_etags_version[] = "@(#) pot revision number is 17.20"; 44char pot_etags_version[] = "@(#) pot revision number is $Revision: 17.22 $";
45 45
46#define TRUE 1 46#define TRUE 1
47#define FALSE 0 47#define FALSE 0
@@ -4955,7 +4955,7 @@ Lua_functions (inf)
4955 if (bp[0] != 'f' && bp[0] != 'l') 4955 if (bp[0] != 'f' && bp[0] != 'l')
4956 continue; 4956 continue;
4957 4957
4958 LOOKING_AT (bp, "local"); /* skip possible "local" */ 4958 (void)LOOKING_AT (bp, "local"); /* skip possible "local" */
4959 4959
4960 if (LOOKING_AT (bp, "function")) 4960 if (LOOKING_AT (bp, "function"))
4961 get_tag (bp, NULL); 4961 get_tag (bp, NULL);
@@ -5137,7 +5137,7 @@ TeX_commands (inf)
5137 if (!opgrp || *p == TEX_clgrp) 5137 if (!opgrp || *p == TEX_clgrp)
5138 { 5138 {
5139 while (*p != '\0' && *p != TEX_opgrp && *p != TEX_clgrp) 5139 while (*p != '\0' && *p != TEX_opgrp && *p != TEX_clgrp)
5140 *p++; 5140 p++;
5141 linelen = p - lb.buffer + 1; 5141 linelen = p - lb.buffer + 1;
5142 } 5142 }
5143 make_tag (cp, namelen, TRUE, 5143 make_tag (cp, namelen, TRUE,
@@ -6256,15 +6256,14 @@ readline (lbp, stream)
6256 /* Check whether this is a #line directive. */ 6256 /* Check whether this is a #line directive. */
6257 if (result > 12 && strneq (lbp->buffer, "#line ", 6)) 6257 if (result > 12 && strneq (lbp->buffer, "#line ", 6))
6258 { 6258 {
6259 int start, lno; 6259 unsigned int lno;
6260 int start = 0;
6260 6261
6261 if (DEBUG) start = 0; /* shut up the compiler */ 6262 if (sscanf (lbp->buffer, "#line %u \"%n", &lno, &start) >= 1
6262 if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1 6263 && start > 0) /* double quote character found */
6263 && lbp->buffer[start] == '"')
6264 { 6264 {
6265 char *endp = lbp->buffer + ++start; 6265 char *endp = lbp->buffer + start;
6266 6266
6267 assert (start > 0);
6268 while ((endp = etags_strchr (endp, '"')) != NULL 6267 while ((endp = etags_strchr (endp, '"')) != NULL
6269 && endp[-1] == '\\') 6268 && endp[-1] == '\\')
6270 endp++; 6269 endp++;