Fix Savannah bug #35410: handle escape chars in filter/filter-out

Also add a valgrind suppression file for Guile-enabled make.
This commit is contained in:
Paul Smith
2012-03-03 22:12:46 +00:00
parent 88f1bc8b55
commit a77c5c0910
6 changed files with 72 additions and 18 deletions

View File

@@ -905,7 +905,6 @@ struct a_pattern
char *str;
char *percent;
int length;
int save_c;
};
static char *
@@ -928,7 +927,9 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
char *p;
unsigned int len;
/* Chop ARGV[0] up into patterns to match against the words. */
/* Chop ARGV[0] up into patterns to match against the words.
We don't need to preserve it because our caller frees all the
argument memory anyway. */
pattail = &pathead;
while ((p = find_next_token (&pat_iterator, &len)) != 0)
@@ -942,12 +943,13 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
++pat_iterator;
pat->str = p;
pat->length = len;
pat->save_c = p[len];
p[len] = '\0';
pat->percent = find_percent (p);
if (pat->percent == 0)
literals++;
/* find_percent() might shorten the string so LEN is wrong. */
pat->length = strlen (pat->str);
}
*pattail = 0;
@@ -1029,9 +1031,6 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
--o;
}
for (pp = pathead; pp != 0; pp = pp->next)
pp->str[pp->length] = pp->save_c;
if (hashing)
hash_free (&a_word_table, 0);
@@ -2377,7 +2376,7 @@ handle_function (char **op, const char **stringp)
if (entry_p->expand_args)
for (argvp=argv; *argvp != 0; ++argvp)
free (*argvp);
if (abeg)
else if (abeg)
free (abeg);
return 1;