subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1130069 - /subversion/trunk/subversion/libsvn_diff/parse-diff.c
Date Wed, 01 Jun 2011 09:31:24 GMT
Author: stsp
Date: Wed Jun  1 09:31:23 2011
New Revision: 1130069

URL: http://svn.apache.org/viewvc?rev=1130069&view=rev
Log:
* subversion/libsvn_diff/parse-diff.c,
  (scan_eol): Do not attempt to read past EOF, and properly detect "\r\n<EOF>".

Found by: julianfoad

Modified:
    subversion/trunk/subversion/libsvn_diff/parse-diff.c

Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1130069&r1=1130068&r2=1130069&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Wed Jun  1 09:31:23 2011
@@ -309,12 +309,12 @@ scan_eol(const char **eol, apr_file_t *f
 
           /* Detect the case where '\r' is the last character in the buffer
            * and '\n' would be the first character in the next buffer. */
-          if (eol_str && eol_str[0] == '\r' && eol_str[1] == '\0' &&
+          if (!eof && eol_str && eol_str[0] == '\r' && eol_str[1]
== '\0' &&
               eolp == buf + len - 1 && total_len < max_len)
             {
               len = 1;
               SVN_ERR(svn_io_file_read_full2(file, buf, 1, &len, &eof, pool));
-              if (!eof && len == 1 && buf[0] == '\n')
+              if (len == 1 && buf[0] == '\n')
                 eol_str = "\r\n";
             }
         }



Mime
View raw message