Print global variables with "set" in function (#38181)
@@ -15,6 +15,8 @@ | ||
15 | 15 | disambiguate presence of special characters. |
16 | 16 | = When the shell prints aliases, variables, key bindings, etc. they |
17 | 17 | are now printed with less quotes. |
18 | + * The "set" built-in without any argument now prints not only local | |
19 | + variables but also global. | |
18 | 20 | * The "." built-in no longer leaves temporary positional parameters |
19 | 21 | after a file-not-found error. |
20 | 22 | * The ">" redirection with the noclobber option is now more |
@@ -1658,9 +1658,10 @@ | ||
1658 | 1658 | export = true; |
1659 | 1659 | } else if (wcscmp(ARGV(0), L"readonly") == 0) { |
1660 | 1660 | global = readonly = true; |
1661 | + } else if (wcscmp(ARGV(0), L"set") == 0) { | |
1662 | + global = true; | |
1661 | 1663 | } else { |
1662 | - assert(wcscmp(ARGV(0), L"typeset") == 0 | |
1663 | - || wcscmp(ARGV(0), L"set") == 0); | |
1664 | + assert(wcscmp(ARGV(0), L"typeset") == 0); | |
1664 | 1665 | } |
1665 | 1666 | |
1666 | 1667 | if (function && global && wcscmp(ARGV(0), L"typeset") == 0) |