diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2012-11-25 12:08:38 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-11-26 13:32:14 -0800 |
commit | 6360bee4cd902bdea5db5826821edffd6f367d89 (patch) | |
tree | 46278f8688e50de8f1866e6f8984b4bf29495df7 /builtin/ls-tree.c | |
parent | imap-send: store all_msgs as a strbuf (diff) | |
download | tgif-6360bee4cd902bdea5db5826821edffd6f367d89.tar.xz |
imap-send: correctly report errors reading from stdin
Previously, read_message() didn't distinguish between an error and eof
when reading its input. This could have resulted in incorrect
behavior if there was an error: (1) reporting "nothing to send" if no
bytes were read or (2) sending an incomplete message if some bytes
were read before the error.
Change read_message() to return -1 on ferror()s and 0 on success, so
that the caller can recognize that an error occurred. (The return
value used to be the length of the input read, which was redundant
because that is already available as the strbuf length.
Change the caller to report errors correctly.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-tree.c')
0 files changed, 0 insertions, 0 deletions