diff options
author | Brian Harring <ferringb@gentoo.org> | 2005-02-09 04:22:50 +0000 |
---|---|---|
committer | Brian Harring <ferringb@gentoo.org> | 2005-02-09 04:22:50 +0000 |
commit | bc2e2a306eac413d0e447b30094ea589ea0cf88c (patch) | |
tree | a3be0b23fc9d2547de0af3050af2d52ab43bcc45 /src | |
parent | change to NO_PARSING mode. allows it to handle escaped chars. (diff) | |
download | portage-cvs-bc2e2a306eac413d0e447b30094ea589ea0cf88c.tar.gz portage-cvs-bc2e2a306eac413d0e447b30094ea589ea0cf88c.tar.bz2 portage-cvs-bc2e2a306eac413d0e447b30094ea589ea0cf88c.zip |
updated filter-env for another type of parsing.
offhand, walk_command probably needs a cleanup for DOLLARED.
Diffstat (limited to 'src')
-rw-r--r-- | src/filter-env/posix.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/filter-env/posix.c b/src/filter-env/posix.c index 8f0128e..2ca2aba 100644 --- a/src/filter-env/posix.c +++ b/src/filter-env/posix.c @@ -16,10 +16,11 @@ #define IO_FAIL 3 #define PARSE_FAIL 4 -#define SPACE_PARSING 3 -#define ESCAPED_PARSING 2 -#define COMMAND_PARSING 1 -#define NO_PARSING 0 +#define SPACE_PARSING 4 +#define ESCAPED_PARSING 3 +#define COMMAND_PARSING 2 +#define DOLLARED_QUOTE_PARSING 1 +#define NO_PARSING 0 void init_regexes(); void free_regexes(); @@ -410,7 +411,7 @@ process_scope(FILE *out_fd, const char *buff, const char *end, regex_t *var_re, if('(' == p[1]) { p=walk_command(p + 2,end, ')',ESCAPED_PARSING); } else if('\'' == p[1]) { - p=walk_command(p + 2,end, '\'', NO_PARSING); + p=walk_command(p + 2,end, '\'', DOLLARED_QUOTE_PARSING); } else if('{' == p[1]) { p=walk_command(p + 2,end, '}', ESCAPED_PARSING); } else { @@ -470,11 +471,14 @@ walk_command(const char *p, const char *end, char endchar, const char interpret_ (interpret_level == SPACE_PARSING && isspace(*p))) { if(!escaped) return p; + } else if(NO_PARSING==interpret_level) { + p++; + continue; } else if('\\' == *p && !escaped) { escaped = 1; p++; continue; } else if(escaped) { escaped = 0; - } else if(NO_PARSING==interpret_level) { + } else if(DOLLARED_QUOTE_PARSING == interpret_level) { p++; continue; } else if('<' == *p) { |