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 B83D0D10A for ; Fri, 24 May 2013 13:15:57 +0000 (UTC) Received: (qmail 28943 invoked by uid 500); 24 May 2013 13:15:57 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 28820 invoked by uid 500); 24 May 2013 13:15:56 -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 28795 invoked by uid 99); 24 May 2013 13:15:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 13:15:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 May 2013 13:15:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id AEB6C238897A; Fri, 24 May 2013 13:15:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1486044 - /subversion/trunk/subversion/libsvn_subr/subst.c Date: Fri, 24 May 2013 13:15:34 -0000 To: commits@subversion.apache.org From: stsp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130524131534.AEB6C238897A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stsp Date: Fri May 24 13:15:34 2013 New Revision: 1486044 URL: http://svn.apache.org/r1486044 Log: Revert r1485848 because it caused segfaults in 'svn diff' on a working copy of Subversion's own trunk. The working copy is corrupted after the crash, some working files contain binary garbage. Also reported to dev@. Modified: subversion/trunk/subversion/libsvn_subr/subst.c Modified: subversion/trunk/subversion/libsvn_subr/subst.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/subst.c?rev=1486044&r1=1486043&r2=1486044&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/subst.c (original) +++ subversion/trunk/subversion/libsvn_subr/subst.c Fri May 24 13:15:34 2013 @@ -50,7 +50,6 @@ #include "svn_private_config.h" #include "private/svn_string_private.h" -#include "private/svn_eol_private.h" /** * The textual elements of a detranslated special file. One of these @@ -1117,39 +1116,28 @@ translate_chunk(svn_stream_t *dst, /* skip current EOL */ len += b->eol_str_len; - if (b->keywords) + /* Check 4 bytes at once to allow for efficient pipelining + and to reduce loop condition overhead. */ + while ((p + len + 4) <= end) { - /* Check 4 bytes at once to allow for efficient pipelining - and to reduce loop condition overhead. */ - while ((p + len + 4) <= end) - { - if (interesting[(unsigned char)p[len]] - || interesting[(unsigned char)p[len+1]] - || interesting[(unsigned char)p[len+2]] - || interesting[(unsigned char)p[len+3]]) - break; - - len += 4; - } - - /* Found an interesting char or EOF in the next 4 bytes. - Find its exact position. */ - while ((p + len) < end - && !interesting[(unsigned char)p[len]]) - ++len; - } - else - { - /* use our optimized sub-routine to find the next EOL */ - const char *eol - = svn_eol__find_eol_start((char *)p + len, end - p); - len += (eol ? eol : end) - (p + len); + if (interesting[(unsigned char)p[len]] + || interesting[(unsigned char)p[len+1]] + || interesting[(unsigned char)p[len+2]] + || interesting[(unsigned char)p[len+3]]) + break; + + len += 4; } + + /* Found an interesting char or EOF in the next 4 bytes. + Find its exact position. */ + while ((p + len) < end && !interesting[(unsigned char)p[len]]) + ++len; } while (b->nl_translation_skippable == svn_tristate_true && /* can potentially skip EOLs */ p + len + 2 < end && /* not too close to EOF */ - eol_unchanged(b, p + len)); /* EOL format already ok */ + eol_unchanged (b, p + len)); /* EOL format already ok */ while ((p + len) < end && !interesting[(unsigned char)p[len]]) len++;