[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1702974 - in /subversion/trunk/subversion: libsvn_subr/token.c libsvn_wc/wc_db.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Mon, 14 Sep 2015 17:50:55 +0200

On 14 September 2015 at 17:43, <rhuijben_at_apache.org> wrote:
> Author: rhuijben
> Date: Mon Sep 14 15:43:31 2015
> New Revision: 1702974
>
> URL: http://svn.apache.org/r1702974
> Log:
> Replace an ugly assertion caused by a corrupt working copy database with an
> almost as ugly, but better to diagnose error message.
>
> Somehow these few cases which should be completely impossible to trigger
> without editing wc.db are reported as TortoiseSVN exception reports.
>
> I explicitly only add these extra checks only to the most common read
> operation, as this function is usually called first and catching every
> invalid working copy database is impossible without a performance and
> a maintenance impact.
>
> * subversion/libsvn_subr/token.c
> (svn_token__from_word_err): Ensure NULL is handled safely.
>
>
> Modified: subversion/trunk/subversion/libsvn_subr/token.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/token.c?rev=1702974&r1=1702973&r2=1702974&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/token.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/token.c Mon Sep 14 15:43:31 2015
> @@ -64,7 +64,7 @@ svn_token__from_word_err(int *value,
> if (*value == SVN_TOKEN_UNKNOWN)
> return svn_error_createf(SVN_ERR_BAD_TOKEN, NULL,
> _("Token '%s' is unrecognized"),
> - word);
> + word ? word : "(null)");
APR handles NULL strings and replaces it with (null) from 0.9.x. So
this change is unnecessary. We also rely on APR handling for NULL
strings in other places.

-- 
Ivan Zhakov
Received on 2015-09-14 17:51:20 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.