diff --git a/eval.c b/eval.c index c7bbbaf..858e322 100644 --- a/eval.c +++ b/eval.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.102 2011/03/17 21:57:50 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/eval.c,v 1.103 2011/03/28 08:27:08 tg Exp $"); /* * string expansion @@ -578,8 +578,11 @@ expand(const char *cp, /* input word */ * in a trim will work as * expected) */ - *dp++ = MAGIC; - *dp++ = (char)('@' | 0x80); + if (!Flag(FSH)) { + *dp++ = MAGIC; + *dp++ = (char)('@' | + 0x80); + } break; case '=': /* @@ -635,8 +638,12 @@ expand(const char *cp, /* input word */ switch (st->stype & 0x17F) { case '#': case '%': - /* Append end-pattern */ - *dp++ = MAGIC; *dp++ = ')'; *dp = '\0'; + if (!Flag(FSH)) { + /* Append end-pattern */ + *dp++ = MAGIC; + *dp++ = ')'; + } + *dp = '\0'; dp = Xrestpos(ds, dp, st->base); /* * Must use st->var since calling diff --git a/lex.c b/lex.c index 23118e1..7d66a8b 100644 --- a/lex.c +++ b/lex.c @@ -22,7 +22,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.144 2011/03/26 16:11:43 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.145 2011/03/28 08:27:09 tg Exp $"); /* * states while lexing word @@ -463,7 +463,7 @@ yylex(int cf) * If this is a trim operation, * treat (,|,) specially in STBRACE. */ - if (ctype(c, C_SUBOP2)) { + if (!Flag(FSH) && ctype(c, C_SUBOP2)) { ungetsc(c); PUSH_STATE(STBRACE); } else {