diff options
author | jilles <jilles@FreeBSD.org> | 2010-09-08 20:35:43 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2010-09-08 20:35:43 +0000 |
commit | 73c5bdeaeb5ee8aa6b736b4af87b87cd8c07c7ba (patch) | |
tree | 87b086c805f45d251c83023ef1956501e5136970 /tools | |
parent | 80b81c30a17cad45014984e9c719c3070ffd81fd (diff) | |
download | FreeBSD-src-73c5bdeaeb5ee8aa6b736b4af87b87cd8c07c7ba.zip FreeBSD-src-73c5bdeaeb5ee8aa6b736b4af87b87cd8c07c7ba.tar.gz |
sh: Fix 'read' if all chars before the first IFS char are backslash-escaped.
Backslash-escaped characters did not set the flag for a non-IFS character.
MFC after: 2 weeks
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/bin/sh/builtins/read4.0 | 10 | ||||
-rw-r--r-- | tools/regression/bin/sh/builtins/read4.0.stdout | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/builtins/read4.0 b/tools/regression/bin/sh/builtins/read4.0 new file mode 100644 index 0000000..7204a35 --- /dev/null +++ b/tools/regression/bin/sh/builtins/read4.0 @@ -0,0 +1,10 @@ +# $FreeBSD$ + +printf '%s\n' '\a\ b c' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\a b\ c' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\a\:b:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\a:b\:c' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\\ a' | { read a b; printf '%s\n' "x${a}x${b}x"; } +printf '%s\n' '\\\:a' | { IFS=: read a b; printf '%s\n' "x${a}x${b}x"; } diff --git a/tools/regression/bin/sh/builtins/read4.0.stdout b/tools/regression/bin/sh/builtins/read4.0.stdout new file mode 100644 index 0000000..a8747a4 --- /dev/null +++ b/tools/regression/bin/sh/builtins/read4.0.stdout @@ -0,0 +1,8 @@ +xa bxcx +xaxb cx +xa:bxcx +xaxb:cx +x\xax +x\xax +x\ axx +x\:axx |