From 1182a75e1b4d46a42935a217e80a2955b76be1a5 Mon Sep 17 00:00:00 2001 From: Barton Schaefer Date: Mon, 20 May 2013 22:44:03 -0700 Subject: upon "read" of a short line, assign all variables passed as arguments. It was noted that (print 1 2 | read one two three four) assigned values only to $one and $two except in the case where EOF was reached. --- ChangeLog | 5 +++++ Src/builtin.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6cdb25ae9..4ce49d11b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-05-20 Barton Schaefer + + * 31416: Src/builtin.c: upon "read" of a short line, assign all + variables passed as arguments. + 2013-05-14 Peter Stephenson * unposted: Completion/Unix/Command/_perforce: Improve diff --git a/Src/builtin.c b/Src/builtin.c index cd886437b..bc91578b3 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5674,7 +5674,7 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func)) zputs(buf, stdout); putchar('\n'); } - if (!OPT_ISSET(ops,'e') && (*buf || first)) { + if (!OPT_ISSET(ops,'e') && (*buf || first || gotnl)) { if (OPT_ISSET(ops,'A')) { addlinknode(readll, buf); al++; -- cgit 1.4.1