You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2012/05/25 18:44:59 UTC

svn commit: r1342720 - in /subversion/trunk: ./ subversion/bindings/javahl/native/InputStream.cpp

Author: hwright
Date: Fri May 25 16:44:59 2012
New Revision: 1342720

URL: http://svn.apache.org/viewvc?rev=1342720&view=rev
Log:
Merge r1342682 from the javahl-ra branch.

Modified:
    subversion/trunk/   (props changed)
    subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp

Propchange: subversion/trunk/
------------------------------------------------------------------------------
  Merged /subversion/branches/javahl-ra:r1342682

Modified: subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp?rev=1342720&r1=1342719&r2=1342720&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp (original)
+++ subversion/trunk/subversion/bindings/javahl/native/InputStream.cpp Fri May 25 16:44:59 2012
@@ -99,6 +99,14 @@ svn_error_t *InputStream::read(void *bat
   if (JNIUtil::isJavaExceptionThrown())
     return SVN_NO_ERROR;
 
+  /*
+   * Convert -1 from InputStream.read that means EOF, 0 which is subversion equivalent
+   */
+  if(jread == -1)
+    {
+      jread = 0;
+    }
+
   // Put the Java byte array into a helper object to retrieve the
   // data bytes.
   JNIByteArray outdata(data, true);
@@ -107,7 +115,7 @@ svn_error_t *InputStream::read(void *bat
 
   // Catch when the Java method tells us it read too much data.
   if (jread > (jint) *len)
-    jread = -1;
+    jread = 0;
 
   // In the case of success copy the data back to the Subversion
   // buffer.