mirror of
https://github.com/ksherlock/mpw-shell.git
synced 2024-12-27 18:30:39 +00:00
include trailing text with the ) token so redirection works correctly
This commit is contained in:
parent
ce1a36eba5
commit
298c601300
@ -60,6 +60,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
action parse_lparen {
|
action parse_lparen {
|
||||||
if (scratch.empty()) {
|
if (scratch.empty()) {
|
||||||
parse(LPAREN, "(");
|
parse(LPAREN, "(");
|
||||||
@ -71,7 +72,8 @@
|
|||||||
action parse_rparen {
|
action parse_rparen {
|
||||||
if (pcount <= 0) {
|
if (pcount <= 0) {
|
||||||
flush();
|
flush();
|
||||||
parse(RPAREN, ")");
|
// parse(RPAREN, ")");
|
||||||
|
scratch.push_back(fc);
|
||||||
fgoto main;
|
fgoto main;
|
||||||
}
|
}
|
||||||
--pcount;
|
--pcount;
|
||||||
@ -179,6 +181,10 @@ int phase2::classify() {
|
|||||||
%%write data;
|
%%write data;
|
||||||
|
|
||||||
if (type) return type;
|
if (type) return type;
|
||||||
|
if (scratch.front() == ')') {
|
||||||
|
type = RPAREN;
|
||||||
|
return type;
|
||||||
|
}
|
||||||
std::string argv0;
|
std::string argv0;
|
||||||
|
|
||||||
const unsigned char *p = (const unsigned char *)scratch.data();
|
const unsigned char *p = (const unsigned char *)scratch.data();
|
||||||
|
Loading…
Reference in New Issue
Block a user