Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7645118E73 for ; Thu, 1 Oct 2015 10:38:40 +0000 (UTC) Received: (qmail 99049 invoked by uid 500); 1 Oct 2015 10:38:40 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 99013 invoked by uid 500); 1 Oct 2015 10:38:40 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 99001 invoked by uid 99); 1 Oct 2015 10:38:40 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Oct 2015 10:38:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C8CDB1A359E for ; Thu, 1 Oct 2015 10:38:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.801 X-Spam-Level: * X-Spam-Status: No, score=1.801 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id o-jEv6xKE1XY for ; Thu, 1 Oct 2015 10:38:38 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 9D412202AF for ; Thu, 1 Oct 2015 10:38:38 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2F244E0428 for ; Thu, 1 Oct 2015 10:38:38 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id E95FB3A027A for ; Thu, 1 Oct 2015 10:38:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1706213 - in /subversion/trunk/subversion: libsvn_client/patch.c libsvn_diff/parse-diff.c Date: Thu, 01 Oct 2015 10:38:37 -0000 To: commits@subversion.apache.org From: rhuijben@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20151001103837.E95FB3A027A@svn01-us-west.apache.org> Author: rhuijben Date: Thu Oct 1 10:38:37 2015 New Revision: 1706213 URL: http://svn.apache.org/viewvc?rev=1706213&view=rev Log: Following up on r1705080, fix a few more final-eol edge cases where different read operations reported EOF at different times, resulting in content mismatches. * subversion/libsvn_client/patch.c (readline_prop, readline_symlink): Report EOF after the last line, not at the last line. * subversion/libsvn_diff/parse-diff.c (hunk_readline_original_or_modified): Always report EOF after the last line, not only in final-eol mode. Modified: subversion/trunk/subversion/libsvn_client/patch.c subversion/trunk/subversion/libsvn_diff/parse-diff.c Modified: subversion/trunk/subversion/libsvn_client/patch.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1706213&r1=1706212&r2=1706213&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_client/patch.c (original) +++ subversion/trunk/subversion/libsvn_client/patch.c Thu Oct 1 10:38:37 2015 @@ -612,7 +612,7 @@ readline_prop(void *baton, svn_stringbuf while (c < b->value->data + b->value->len); if (eof) - *eof = found_eof; + *eof = found_eof && !(str && str->len > 0); *line = str; return SVN_NO_ERROR; @@ -831,6 +831,7 @@ readline_symlink(void *baton, svn_string SVN_ERR(svn_subst_read_specialfile(&stream, sb->local_abspath, scratch_pool, scratch_pool)); SVN_ERR(svn_stringbuf_from_stream(line, stream, len_hint, result_pool)); + *eof = FALSE; sb->at_eof = TRUE; } @@ -1686,8 +1687,6 @@ get_hunk_info(hunk_info_t **hi, patch_ta { svn_boolean_t file_matches; - /* ### I can't reproduce anything but a no-match here. - The content is already at eof, so any hunk fails */ SVN_ERR(match_existing_target(&file_matches, content, hunk, scratch_pool)); if (file_matches) Modified: subversion/trunk/subversion/libsvn_diff/parse-diff.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_diff/parse-diff.c?rev=1706213&r1=1706212&r2=1706213&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_diff/parse-diff.c (original) +++ subversion/trunk/subversion/libsvn_diff/parse-diff.c Thu Oct 1 10:38:37 2015 @@ -706,7 +706,7 @@ hunk_readline_original_or_modified(apr_f *stringbuf = svn_stringbuf_dup(str, result_pool); } - if (!filtered && *eof && !*eol && !no_final_eol && *str->data) + if (!filtered && *eof && !*eol && *str->data) { /* Ok, we miss a final EOL in the patch file, but didn't see a no eol marker line. @@ -714,7 +714,7 @@ hunk_readline_original_or_modified(apr_f We should report that we had an EOL or the patch code will misbehave (and it knows nothing about no eol markers) */ - if (eol != &eol_p) + if (!no_final_eol && eol != &eol_p) { apr_off_t start = 0;