fix dollar quotes in here strings and here documents (regression)

This commit is contained in:
tg
2009-10-04 12:44:19 +00:00
parent 40d11a2066
commit c2e5737fca
2 changed files with 23 additions and 3 deletions

5
lex.c
View File

@@ -22,7 +22,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.98 2009/10/02 18:08:34 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.99 2009/10/04 12:44:19 tg Exp $");
/*
* states while lexing word
@@ -460,7 +460,8 @@ yylex(int cf)
*wp++ = '\0';
*wp++ = CSUBST;
*wp++ = 'X';
} else if (c == '\'') {
} else if (c == '\'' && (state == SBASE)) {
/* XXX which other states are valid? */
*wp++ = OQUOTE;
ignore_backslash_newline++;
PUSH_STATE(SEQUOTE);