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

Re: svn commit: r1664596 - /subversion/trunk/subversion/libsvn_subr/config_win.c

From: Ivan Zhakov <ivan_at_visualsvn.com>
Date: Wed, 15 Apr 2015 20:33:24 +0300

On 6 March 2015 at 15:02, <rhuijben_at_apache.org> wrote:
>
> Author: rhuijben
> Date: Fri Mar 6 12:02:30 2015
> New Revision: 1664596
>
> URL: http://svn.apache.org/r1664596
> Log:
> * subversion/libsvn_subr/config_win.c
> (svn_config__parse_registry): Hide the ENOENT errors from the chain,
> but keep others.
>
> Modified:
> subversion/trunk/subversion/libsvn_subr/config_win.c
>
> Modified: subversion/trunk/subversion/libsvn_subr/config_win.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config_win.c?rev=1664596&r1=1664595&r2=1664596&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/config_win.c (original)
> +++ subversion/trunk/subversion/libsvn_subr/config_win.c Fri Mar 6 12:02:30 2015
> @@ -198,10 +198,12 @@ svn_config__parse_registry(svn_config_t
> if (err != ERROR_SUCCESS)
> {
> apr_status_t apr_err = APR_FROM_OS_ERROR(err);
> + svn_boolean_t is_enoent = APR_STATUS_IS_ENOENT(apr_err);
>
> - if (must_exist || !APR_STATUS_IS_ENOENT(apr_err))
> + if (must_exist || !is_enoent)
> return svn_error_createf(SVN_ERR_BAD_FILENAME,
> - svn_error_wrap_apr(apr_err, NULL),
> + is_enoent ? NULL
> + : svn_error_wrap_apr(apr_err, NULL),
> _("Can't open registry key '%s'"),
> svn_dirent_local_style(file, pool));
Hi Bert,

What do you think about refactoring condition above like in attached patch?

-- 
Ivan Zhakov

Received on 2015-04-15 19:35:42 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.