blob: 032059295e2eb7e3186a9461b911f485c40f128d [file] [log] [blame]
Denys Vlasenko51b4a9e2010-05-18 14:35:20 +02001# true is a regular builtin, varibale should not leak out of it
2# this currently fails with CONFIG_FEATURE_SH_NOFORK=y
Denis Vlasenko6d1ebec2008-04-13 17:45:56 +00003VAR=''
Denys Vlasenko51b4a9e2010-05-18 14:35:20 +02004VAR=val1 true
Denis Vlasenko6d1ebec2008-04-13 17:45:56 +00005echo "should be empty: '$VAR'"
6
Denys Vlasenko51b4a9e2010-05-18 14:35:20 +02007# ash follows the "special builtin leaks variables" rule here:
8# exec is a special builtin. (bash does not do it)
Denis Vlasenko6d1ebec2008-04-13 17:45:56 +00009VAR=''
Denys Vlasenko51b4a9e2010-05-18 14:35:20 +020010VAR=val2 exec 2>&1
11echo "should be not empty: '$VAR'"
12
13# ash follows the "function call is a special builtin" rule here
14# (bash does not do it)
15f() { true; }
16VAR=''
17VAR=val3 f
18echo "should be not empty: '$VAR'"