Seems that unit testing is actually useful: 
fix EOF issue with translated streams detected by unit testing.

* subversion/libsvn_subr/subst.c
  (translated_stream_skip): stop reading from the stream
   if we aren't getting any more data.

git-svn-id: https://svn.apache.org/repos/asf/subversion/branches/integrate-stream-api-extensions@1072514 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/subversion/libsvn_subr/subst.c b/subversion/libsvn_subr/subst.c
index 3fb96c2..41982d0 100644
--- a/subversion/libsvn_subr/subst.c
+++ b/subversion/libsvn_subr/subst.c
@@ -1255,12 +1255,12 @@
                        apr_size_t *count)
 {
   apr_size_t total_bytes_read = 0;
-  apr_size_t bytes_read;
+  apr_size_t bytes_read = 1;
   char buffer[SVN__STREAM_CHUNK_SIZE];
   svn_error_t *err = SVN_NO_ERROR;
   apr_size_t to_read = *count;
 
-  while ((to_read > 0) && !err)
+  while ((to_read > 0) && !err && (bytes_read > 0))
     {
       bytes_read = sizeof(buffer) < to_read ? sizeof(buffer) : to_read;
       err = translated_stream_read(baton, buffer, &bytes_read);