summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2010-09-09 12:58:19 +0200
committerDenys Vlasenko2010-09-09 12:58:19 +0200
commit850b15bfafb08d24ae3e55f5ca8b848b17958f8a (patch)
tree27e7b4f4b32674b6b7c204f07ce241044005ce94
parent77a7b5519cace3722832d03ce09faa950841b509 (diff)
downloadbusybox-850b15bfafb08d24ae3e55f5ca8b848b17958f8a.zip
busybox-850b15bfafb08d24ae3e55f5ca8b848b17958f8a.tar.gz
hush: simplify parse_stream_dquoted
function old new delta parse_stream_dquoted 303 250 -53 Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--shell/hush.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/shell/hush.c b/shell/hush.c
index d76fe85..5af5259 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -3777,15 +3777,12 @@ static int parse_stream_dquoted(o_string *as_string,
* NB: in (unquoted) heredoc, above does not apply to ".
*/
if (next == dquote_end || strchr("$`\\\n", next) != NULL) {
- ch = i_getch(input);
- if (ch != '\n') {
- o_addqchr(dest, ch);
- nommu_addchr(as_string, ch);
- }
- } else {
- o_addqchr(dest, '\\');
- nommu_addchr(as_string, '\\');
- }
+ ch = i_getch(input); /* eat next */
+ if (ch == '\n')
+ goto again; /* skip \<newline> */
+ } /* else: ch remains == '\\', and we double it */
+ o_addqchr(dest, ch);
+ nommu_addchr(as_string, ch);
goto again;
}
if (ch == '$') {
@@ -3808,13 +3805,6 @@ static int parse_stream_dquoted(o_string *as_string,
}
#endif
o_addQchr(dest, ch);
- if (ch == '='
- && (dest->o_assignment == MAYBE_ASSIGNMENT
- || dest->o_assignment == WORD_IS_KEYWORD)
- && is_well_formed_var_name(dest->data, '=')
- ) {
- dest->o_assignment = DEFINITELY_ASSIGNMENT;
- }
goto again;
#undef as_string
}