• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3834 (tree)
Zeit2018-04-09 00:08:03
Autormagicant

Log Message

Print global variables with "set" in function (#38181)

Ändern Zusammenfassung

Diff

--- yash/trunk/NEWS (revision 3833)
+++ yash/trunk/NEWS (revision 3834)
@@ -15,6 +15,8 @@
1515 disambiguate presence of special characters.
1616 = When the shell prints aliases, variables, key bindings, etc. they
1717 are now printed with less quotes.
18+ * The "set" built-in without any argument now prints not only local
19+ variables but also global.
1820 * The "." built-in no longer leaves temporary positional parameters
1921 after a file-not-found error.
2022 * The ">" redirection with the noclobber option is now more
--- yash/trunk/variable.c (revision 3833)
+++ yash/trunk/variable.c (revision 3834)
@@ -1658,9 +1658,10 @@
16581658 export = true;
16591659 } else if (wcscmp(ARGV(0), L"readonly") == 0) {
16601660 global = readonly = true;
1661+ } else if (wcscmp(ARGV(0), L"set") == 0) {
1662+ global = true;
16611663 } else {
1662- assert(wcscmp(ARGV(0), L"typeset") == 0
1663- || wcscmp(ARGV(0), L"set") == 0);
1664+ assert(wcscmp(ARGV(0), L"typeset") == 0);
16641665 }
16651666
16661667 if (function && global && wcscmp(ARGV(0), L"typeset") == 0)
Show on old repository browser