diff options
author | 2004-11-23 02:41:30 +0000 | |
---|---|---|
committer | 2004-11-23 02:41:30 +0000 | |
commit | 8a59b69f9f23f412201421d740628485be9b5a1c (patch) | |
tree | 910ea12c27cdc402360535cf980c77829aae31b8 /src | |
parent | lalala (diff) | |
download | portage-cvs-8a59b69f9f23f412201421d740628485be9b5a1c.tar.gz portage-cvs-8a59b69f9f23f412201421d740628485be9b5a1c.tar.bz2 portage-cvs-8a59b69f9f23f412201421d740628485be9b5a1c.zip |
added a few asserts.
Diffstat (limited to 'src')
-rw-r--r-- | src/filter-env/posix.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/filter-env/posix.c b/src/filter-env/posix.c index 8f96bde..2c04232 100644 --- a/src/filter-env/posix.c +++ b/src/filter-env/posix.c @@ -8,6 +8,7 @@ #include <regex.h> #include <unistd.h> #include <ctype.h> +#include <assert.h> #include "bmh_search.h" #define USAGE_FAIL 1 @@ -298,6 +299,8 @@ regex_matches(regex_t *re, const char *buff) { regmatch_t match[1]; match[0].rm_so = match[0].rm_eo = -1; + assert(buff != NULL); + assert(re != NULL); regexec(re, buff, 1, match, 0); // fprintf(stderr,"result was %i for %s, returning %i\n", match[0].rm_so, buff,i); return match[0].rm_so != -1 ? 1 : 0; @@ -524,8 +527,7 @@ walk_command(const char *p, const char *end, char endchar, const char interpret_ // p=process_scope(NULL,p+1,end,NULL,NULL,'}'); p=walk_command(p+1,end, '}', ESCAPED_PARSING); // kind of a hack. -// fprintf(stderr, "returned char %c\n", *p); - } else if('(' == *p && endchar!='"') { + } else if('(' == *p && interpret_level == COMMAND_PARSING) { p=walk_command(p + 1, end, ')',ESCAPED_PARSING); } else if('`' == *p || '"' == *p) { p=walk_command(p + 1, end, *p, ESCAPED_PARSING); |