break; /* return readtoken1(...) */
if ((int)(p - xxreadtoken_chars) >= xxreadtoken_singles) {
- int cc = pgetc();
+ int cc = pgetc_eatbnl();
if (cc == c) { /* double occurrence? */
p += xxreadtoken_doubles + 1;
} else {
nommu_addchr(&ctx.as_string, ch);
next = '\0';
- if (ch != '\n')
+ if (ch != '\n') {
next = i_peek(input);
+ /* Can't use i_peek_and_eat_bkslash_nl(input) here:
+ * echo '\
+ * '
+ * will break.
+ */
+ }
is_special = "{}<>;&|()#'" /* special outside of "str" */
"\\$\"" IF_HUSH_TICK("`") /* always special */
/* Eat multiple semicolons, detect
* whether it means something special */
while (1) {
- ch = i_peek(input);
+ ch = i_peek_and_eat_bkslash_nl(input);
if (ch != ';')
break;
ch = i_getch(input);
if (done_word(&dest, &ctx)) {
goto parse_error;
}
+ if (next == '\\')
+ next = i_peek_and_eat_bkslash_nl(input);
if (next == '&') {
ch = i_getch(input);
nommu_addchr(&ctx.as_string, ch);
if (ctx.ctx_res_w == RES_MATCH)
break; /* we are in case's "word | word)" */
#endif
+ if (next == '\\')
+ next = i_peek_and_eat_bkslash_nl(input);
if (next == '|') { /* || */
ch = i_getch(input);
nommu_addchr(&ctx.as_string, ch);