aboutsummaryrefslogtreecommitdiff
path: root/shell/ash_test
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-03-31 19:18:17 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-03-31 19:18:17 +0000
commit46aeab9a349d097307a87d7dfde3057f9e4e6722 (patch)
treed348fadeb6bc0766c21bfc850a174a059fe4c732 /shell/ash_test
parent7566bae19715a493f40fd3fae4d69d10089af411 (diff)
downloadbusybox-w32-46aeab9a349d097307a87d7dfde3057f9e4e6722.tar.gz
busybox-w32-46aeab9a349d097307a87d7dfde3057f9e4e6722.tar.bz2
busybox-w32-46aeab9a349d097307a87d7dfde3057f9e4e6722.zip
ash: fix $IFS handling in read. closes bug 235
Diffstat (limited to 'shell/ash_test')
-rw-r--r--shell/ash_test/ash-read/read_ifs.right7
-rwxr-xr-xshell/ash_test/ash-read/read_ifs.tests7
2 files changed, 14 insertions, 0 deletions
diff --git a/shell/ash_test/ash-read/read_ifs.right b/shell/ash_test/ash-read/read_ifs.right
new file mode 100644
index 000000000..027ecd18f
--- /dev/null
+++ b/shell/ash_test/ash-read/read_ifs.right
@@ -0,0 +1,7 @@
1.a. .b. .c.
2.a. .b. .c.
3.a. .. .b,c.
4.a. .. .b,c.
5.a. .. .c.
6.a. .. .c. .d.
7.a. .. .b,c,d , ,.
diff --git a/shell/ash_test/ash-read/read_ifs.tests b/shell/ash_test/ash-read/read_ifs.tests
new file mode 100755
index 000000000..cf7cd934c
--- /dev/null
+++ b/shell/ash_test/ash-read/read_ifs.tests
@@ -0,0 +1,7 @@
1printf 'a\t\tb\tc\n' | ( IFS=$(printf "\t") read a b c; echo ".$a. .$b. .$c." )
2printf 'a\t\tb\tc\n' | ( IFS=$(printf " \t") read a b c; echo ".$a. .$b. .$c." )
3printf 'a,,b,c\n' | ( IFS="," read a b c; echo ".$a. .$b. .$c." )
4printf 'a,,b,c\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." )
5printf 'a ,, c\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." )
6printf 'a ,, c d\n' | ( IFS=" ," read a b c d; echo ".$a. .$b. .$c. .$d." )
7printf ' a,,b,c,d , ,\n' | ( IFS=" ," read a b c; echo ".$a. .$b. .$c." )