• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3898 (tree)
Time2018-09-30 02:20:05
Authormagicant

Log Message

Don't alias-substitute "do" in for command (#38575)

Change Summary

Incremental Difference

--- yash/trunk/NEWS (revision 3897)
+++ yash/trunk/NEWS (revision 3898)
@@ -19,6 +19,8 @@
1919 a here-document redirection operator are now correctly parsed
2020 even when it resulted from an alias substitution whose value
2121 begins with a blank.
22+ * The "do" keyword in a for loop is no longer subject to alias
23+ substitution.
2224 . Updated the sample initialization script (yashrc):
2325 = The prompt strings are now defined with the $YASH_PS...
2426 variables.
--- yash/trunk/parser.c (revision 3897)
+++ yash/trunk/parser.c (revision 3898)
@@ -2427,7 +2427,7 @@
24272427 result->c_forwords = parse_words(ps, false);
24282428 if (ps->tokentype == TT_SEMICOLON)
24292429 next_token(ps);
2430- } else if (psubstitute_alias(ps, 0)) {
2430+ } else if (ps->tokentype != TT_DO && psubstitute_alias(ps, 0)) {
24312431 goto parse_in;
24322432 } else {
24332433 result->c_forwords = NULL;
Show on old repository browser