commit 9b2653be1ef81437fe73fe9a8670ab3fcddeda78
Author:     Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Fri Jan 20 09:31:12 2017 +0100
Commit:     Mattias Andrée <maandree_AT_kth.se>
CommitDate: Fri Jan 20 09:31:12 2017 +0100
    Forgot to commit a file
    
    Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/src/stream.c b/src/stream.c
index 04dd516..4b2cc23 100644
--- a/src/stream.c
+++ b/src/stream.c
_AT_@ -17,13 +17,17 @@ eninit_stream(int status, struct stream *stream)
         size_t n;
         char *p = NULL, *w, *h, *f, *end;
 
-	for (stream->ptr = 0; stream->fd >= 0 && !p;) {
-		r = read(stream->fd, stream->buf + stream->ptr, sizeof(stream->buf) - stream->ptr);
-		if (r < 0)
-			enprintf(status, "read %s:", stream->file);
-		if (r == 0)
-			goto bad_format;
-		stream->ptr += (size_t)r;
+	if (stream->fd >= 0) {
+		for (stream->ptr = 0; !p;) {
+			r = read(stream->fd, stream->buf + stream->ptr, sizeof(stream->buf) - stream->ptr);
+			if (r < 0)
+				enprintf(status, "read %s:", stream->file);
+			if (r == 0)
+				goto bad_format;
+			stream->ptr += (size_t)r;
+			p = memchr(stream->buf, '\n', stream->ptr);
+		}
+	} else {
                 p = memchr(stream->buf, '\n', stream->ptr);
         }
 
_AT_@ -281,7 +285,7 @@ nprocess_multiple_streams(int status, struct stream *streams, size_t n_streams,
         while (n_streams) {
                 n = SIZE_MAX;
                 for (i = 0; i < n_streams; i++) {
-			if (streams[i].ptr < sizeof(streams->buf) && !eread_stream(streams + i, SIZE_MAX)) {
+			if (streams[i].ptr < sizeof(streams->buf) && !enread_stream(status, streams + i, SIZE_MAX)) {
                                 close(streams[i].fd);
                                 streams[i].fd = -1;
                         }
Received on Fri Jan 20 2017 - 09:31:21 CET
This archive was generated by hypermail 2.3.0
: Fri Jan 20 2017 - 09:36:16 CET