permit $'\n' in the bar part of ${foo:-bar}

XXX this changes slightly the herestring part
This commit is contained in:
tg
2013-01-19 17:49:46 +00:00
parent 24164e07d4
commit 72402c4990

8
lex.c
View File

@@ -23,7 +23,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.175 2013/01/19 17:20:02 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/lex.c,v 1.176 2013/01/19 17:49:46 tg Exp $");
/* /*
* states while lexing word * states while lexing word
@@ -504,15 +504,13 @@ yylex(int cf)
*wp++ = '\0'; *wp++ = '\0';
*wp++ = CSUBST; *wp++ = CSUBST;
*wp++ = 'X'; *wp++ = 'X';
} else if (c == '\'' && (state == SBASE)) { } else if (c == '\'' && !(cf & HEREDOC)) {
/* XXX which other states are valid? */
*wp++ = OQUOTE; *wp++ = OQUOTE;
ignore_backslash_newline++; ignore_backslash_newline++;
PUSH_STATE(SEQUOTE); PUSH_STATE(SEQUOTE);
statep->ls_bool = false; statep->ls_bool = false;
break; break;
} else if (c == '"' && (state == SBASE)) { } else if (c == '"' && !(cf & HEREDOC)) {
/* XXX which other states are valid? */
goto DEQUOTE; goto DEQUOTE;
} else { } else {
*wp++ = CHAR; *wp++ = CHAR;