diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-23 21:02:15 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-10-23 21:02:15 +0200 |
commit | 6a0d7490ea6ad97aeafb9da04acab13bd3c38e4d (patch) | |
tree | ed74f2d281d2dae776f3105034717c049de77946 /testsuite | |
parent | 54779a47e9fa7f85b2a2ff744b9121f31a7758a9 (diff) | |
download | busybox-w32-6a0d7490ea6ad97aeafb9da04acab13bd3c38e4d.tar.gz busybox-w32-6a0d7490ea6ad97aeafb9da04acab13bd3c38e4d.tar.bz2 busybox-w32-6a0d7490ea6ad97aeafb9da04acab13bd3c38e4d.zip |
awk: fix segfault on closing non-opened file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/awk.tests | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 56b11ca46..0afe9b9e7 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests | |||
@@ -77,6 +77,12 @@ testing "awk string cast (bug 725)" \ | |||
77 | testing "awk handles whitespace before array subscript" \ | 77 | testing "awk handles whitespace before array subscript" \ |
78 | "awk 'BEGIN { arr [3] = 1; print arr [3] }'" "1\n" "" "" | 78 | "awk 'BEGIN { arr [3] = 1; print arr [3] }'" "1\n" "" "" |
79 | 79 | ||
80 | # GNU awk 3.1.5's "print ERRNO" prints "No such file or directory" instead of "2", | ||
81 | # do we need to emulate that as well? | ||
82 | testing "awk handles non-existing file correctly" \ | ||
83 | "awk 'BEGIN { getline line <\"doesnt_exist\"; print ERRNO; ERRNO=0; close(\"doesnt_exist\"); print ERRNO; print \"Ok\" }'" \ | ||
84 | "2\n0\nOk\n" "" "" | ||
85 | |||
80 | prg=' | 86 | prg=' |
81 | BEGIN { | 87 | BEGIN { |
82 | u["a"]=1 | 88 | u["a"]=1 |