diff --git a/lex.c b/lex.c index a5a1009..b552dfc 100644 --- a/lex.c +++ b/lex.c @@ -2,7 +2,7 @@ /*- * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, - * 2011, 2012, 2013, 2014, 2015 + * 2011, 2012, 2013, 2014, 2015, 2016 * mirabilos * * Provided that these terms and disclaimer and all copyright notices @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.214 2015/12/12 19:05:52 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/lex.c,v 1.215 2016/01/14 19:52:20 tg Exp $"); /* * states while lexing word @@ -777,6 +777,7 @@ yylex(int cf) Source *s; ungetsc(c2); + ungetsc(c); /* * mismatched parenthesis - * assume we were really @@ -789,6 +790,7 @@ yylex(int cf) s->start = s->str = s->u.freeme = dp; s->next = source; source = s; + ungetsc('('/*)*/); return ('('/*)*/); } } else if (c == '(') diff --git a/syn.c b/syn.c index 6b41b4d..6c787b8 100644 --- a/syn.c +++ b/syn.c @@ -2,7 +2,7 @@ /*- * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, - * 2011, 2012, 2013, 2014, 2015 + * 2011, 2012, 2013, 2014, 2015, 2016 * mirabilos * * Provided that these terms and disclaimer and all copyright notices @@ -23,7 +23,7 @@ #include "sh.h" -__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.107 2015/12/12 21:03:53 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/syn.c,v 1.108 2016/01/14 19:52:20 tg Exp $"); struct nesting_state { int start_token; /* token than began nesting (eg, FOR) */ @@ -400,6 +400,7 @@ get_command(int cf) case LWORD: break; case '(': /*)*/ + c = '('; goto Subshell; default: syntaxerr(NULL);