Author: rhuijben
Date: Sat Jul 20 23:08:52 2013
New Revision: 1505237

URL: http://svn.apache.org/r1505237
Log:
* subversion/libsvn_subr/io.c
  (stringbuf_from_aprfile): Following up on r1505217, check whether a 0 byte
    result is really for a file, before returning a 0 byte buffer for it.

Modified:
    subversion/trunk/subversion/libsvn_subr/io.c

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1505237&r1=1505236&r2=1505237&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Sat Jul 20 23:08:52 2013
@@ -2342,7 +2342,10 @@ stringbuf_from_aprfile(svn_stringbuf_t *
     {
       apr_finfo_t finfo;
 
-      if (! apr_file_info_get(&finfo, APR_FINFO_SIZE, file))
+      /* In some cases we get size 0 and no error for non files,
+          so we also check for the name. (= cached in apr_file_t) */
+      if (! apr_file_info_get(&finfo, APR_FINFO_SIZE | APR_FINFO_NAME, file)
+          && finfo.name != NULL)
         {
           /* we've got the file length. Now, read it in one go. */
           svn_boolean_t eof;
@@ -2375,7 +2378,7 @@ stringbuf_from_aprfile(svn_stringbuf_t *
 
   /* Having read all the data we *expect* EOF */
   if (err && !APR_STATUS_IS_EOF(err->apr_err))
-    return err;
+    return svn_error_trace(err);
   svn_error_clear(err);
 
   *result = res;


Reply via email to