diff options
author | Denys Vlasenko | 2009-11-30 01:15:04 +0100 |
---|---|---|
committer | Denys Vlasenko | 2009-11-30 01:15:04 +0100 |
commit | 1284774d60ebce68dec6fcaf44a33e928c4c1f82 (patch) | |
tree | 165bc1ec980eca2d30b04d7939bafbf7667fc1b8 /testsuite | |
parent | cdeda16ee4acb78569598e848a491ad595af3abb (diff) | |
download | busybox-1284774d60ebce68dec6fcaf44a33e928c4c1f82.zip busybox-1284774d60ebce68dec6fcaf44a33e928c4c1f82.tar.gz |
awk: fix an incorrect casting to string (bug 725). -44 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 2c7642c..7910c88 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -47,4 +47,21 @@ testing "awk NF in BEGIN" \ ":0::::\n" \ "" "" +prg=' +function b(tmp) { + tmp = 0; + print "" tmp; #this line causes the bug + return tmp; +} +function c(tmpc) { + tmpc = b(); return tmpc; +} +BEGIN { + print (c() ? "string" : "number"); +}' +testing "awk string cast (bug 725)" \ + "awk '$prg'" \ + "0\nnumber\n" \ + "" "" + exit $FAILCOUNT |