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 675B7D9E3 for ; Thu, 27 Sep 2012 14:16:29 +0000 (UTC) Received: (qmail 51778 invoked by uid 500); 27 Sep 2012 14:16:29 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 51759 invoked by uid 500); 27 Sep 2012 14:16:29 -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 51752 invoked by uid 99); 27 Sep 2012 14:16:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Sep 2012 14:16:29 +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; Thu, 27 Sep 2012 14:16:27 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7B47A2388906; Thu, 27 Sep 2012 14:15:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1391020 - /subversion/trunk/subversion/svndumpfilter/main.c Date: Thu, 27 Sep 2012 14:15:44 -0000 To: commits@subversion.apache.org From: stsp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120927141544.7B47A2388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stsp Date: Thu Sep 27 14:15:43 2012 New Revision: 1391020 URL: http://svn.apache.org/viewvc?rev=1391020&view=rev Log: Fix issue #4234, "svndumpfilter exclude --targets wants pathname to start with '/'" * subversion/svndumpfilter/main.c (main): While parsing through the 'targets' file, check for a leading slash('/') in every path prefix. If it is not there, prepend a '/'. Found by: Jeyanthan Patch by: Vijayaguru G (Tweaked by me to avoid shadowed declaration of local variable 'i'.) Modified: subversion/trunk/subversion/svndumpfilter/main.c Modified: subversion/trunk/subversion/svndumpfilter/main.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svndumpfilter/main.c?rev=1391020&r1=1391019&r2=1391020&view=diff ============================================================================== --- subversion/trunk/subversion/svndumpfilter/main.c (original) +++ subversion/trunk/subversion/svndumpfilter/main.c Thu Sep 27 14:15:43 2012 @@ -1526,6 +1526,8 @@ main(int argc, const char *argv[]) { svn_stringbuf_t *buffer, *buffer_utf8; const char *utf8_targets_file; + apr_array_header_t *targets = apr_array_make(pool, 0, + sizeof(const char *)); /* We need to convert to UTF-8 now, even before we divide the targets into an array, because otherwise we wouldn't @@ -1538,10 +1540,18 @@ main(int argc, const char *argv[]) pool)); SVN_INT_ERR(svn_utf_stringbuf_to_utf8(&buffer_utf8, buffer, pool)); - opt_state.prefixes = apr_array_append(pool, - svn_cstring_split(buffer_utf8->data, "\n\r", - TRUE, pool), - opt_state.prefixes); + targets = apr_array_append(pool, + svn_cstring_split(buffer_utf8->data, "\n\r", + TRUE, pool), + targets); + + for (i = 0; i < targets->nelts; i++) + { + const char *prefix = APR_ARRAY_IDX(targets, i, const char *); + if (prefix[0] != '/') + prefix = apr_pstrcat(pool, "/", prefix, (char *)NULL); + APR_ARRAY_PUSH(opt_state.prefixes, const char *) = prefix; + } } if (apr_is_empty_array(opt_state.prefixes))