Denys Vlasenko | 51b4a9e | 2010-05-18 14:35:20 +0200 | [diff] [blame^] | 1 | # true is a regular builtin, varibale should not leak out of it |
| 2 | # this currently fails with CONFIG_FEATURE_SH_NOFORK=y |
Denis Vlasenko | 6d1ebec | 2008-04-13 17:45:56 +0000 | [diff] [blame] | 3 | VAR='' |
Denys Vlasenko | 51b4a9e | 2010-05-18 14:35:20 +0200 | [diff] [blame^] | 4 | VAR=val1 true |
Denis Vlasenko | 6d1ebec | 2008-04-13 17:45:56 +0000 | [diff] [blame] | 5 | echo "should be empty: '$VAR'" |
| 6 | |
Denys Vlasenko | 51b4a9e | 2010-05-18 14:35:20 +0200 | [diff] [blame^] | 7 | # ash follows the "special builtin leaks variables" rule here: |
| 8 | # exec is a special builtin. (bash does not do it) |
Denis Vlasenko | 6d1ebec | 2008-04-13 17:45:56 +0000 | [diff] [blame] | 9 | VAR='' |
Denys Vlasenko | 51b4a9e | 2010-05-18 14:35:20 +0200 | [diff] [blame^] | 10 | VAR=val2 exec 2>&1 |
| 11 | echo "should be not empty: '$VAR'" |
| 12 | |
| 13 | # ash follows the "function call is a special builtin" rule here |
| 14 | # (bash does not do it) |
| 15 | f() { true; } |
| 16 | VAR='' |
| 17 | VAR=val3 f |
| 18 | echo "should be not empty: '$VAR'" |