aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin.cpp
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-09-21 20:00:26 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-09-21 20:00:26 -0700
commita012aedb31b4b959dfd66d6643c43564408a9f00 (patch)
tree67046b85811cf4050b05481c3f7b94976b6014e6 /builtin.cpp
parenta9c8b755992703f5499e2da91d50579cbd65046d (diff)
Fix incorrect error on `read` with 1-character input
When `read` is given a single character of input (including the newline), it was bailing as if it had been given no input. This is incorrect.
Diffstat (limited to 'builtin.cpp')
-rw-r--r--builtin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin.cpp b/builtin.cpp
index 4604190c..e7c49285 100644
--- a/builtin.cpp
+++ b/builtin.cpp
@@ -2655,7 +2655,7 @@ static int builtin_read(parser_t &parser, wchar_t **argv)
}
}
- if (buff.size() < 2 && eof)
+ if (buff.empty() && eof)
{
exit_res = 1;
}