read_istream_filtered: propagate read error from upstream
The filter istream pulls data from an "upstream" stream, running it through a filter function. However, we did not properly notice when the upstream filter yielded an error, and just returned what we had read. Instead, we should propagate the error. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Mar 25, 2013 at 16:18 UTC
42e7e2a53492ed1772b7b5d8b328f8d0a66f8b33
1 file changed
+1
-1
streaming.c
+1
-1
@@ -237,7 +237,7 @@ static read_method_decl(filtered)
237
if (!fs->input_finished) {
238
fs->i_end = read_istream(fs->upstream, fs->ibuf, FILTER_BUFFER);
239
if (fs->i_end < 0)
240
- break;
240
+ return -1;
241
if (fs->i_end)
242
continue;
243
}