Browse files

backslash- and EOT-safe getc

  • Loading branch information...
1 parent d4d8c79 commit ea2d74ec3bc6831247689ff421c8b0a57a61d576 @jneen committed Jul 19, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/util.sh
View
2 lib/util.sh
@@ -33,7 +33,7 @@ pluralize() {
# for an explanation of this getc implementation, see
# http://write.jayferd.us/2011/01/12/bash-adventures-read-a-single-character-even-if-its-a-newline/
getc() {
- IFS= read -d"$(echo -e '\004')" -n1 "$@"
+ IFS= read -r -n1 -d '' "$@"
}
read_until() {

0 comments on commit ea2d74e

Please sign in to comment.