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

Re: patch: don't bail when ALLUSERPROFILE is missing

From: Stefan Sperling <stsp_at_elego.de>
Date: Tue, 16 Jun 2009 18:21:33 +0100

On Tue, Jun 16, 2009 at 07:07:57PM +0200, Stefan Küng wrote:
> [[[
> Do not bail if the ALLUSERPROFILE folder does not exist.
> * subversion/libsvn_subr/config.c
> (get_category_config): handle the error gracefully.
> ]]]
> Index: subversion/libsvn_subr/config.c
> ===================================================================
> --- subversion/libsvn_subr/config.c (Revision 38046)
> +++ subversion/libsvn_subr/config.c (Arbeitskopie)
> @@ -198,6 +198,7 @@
> {
> const char *usr_reg_path = NULL, *sys_reg_path = NULL;
> const char *usr_cfg_path, *sys_cfg_path;
> + svn_error_t *error = NULL;

Minor nitpick: We usually call errors just "err".

> *cfg = NULL;
>
> @@ -210,7 +211,14 @@
> category, NULL);
> #endif /* WIN32 */
>
> - SVN_ERR(svn_config__sys_config_path(&sys_cfg_path, category, pool));
> + error = svn_config__sys_config_path(&sys_cfg_path, category, pool);
> + if ((error)&&(error->apr_err == SVN_ERR_BAD_FILENAME))

We also usually put spaces around operators like &&.

Looks good to me otherwise, though I can't test this because
I don't run Windows.

Stefan

> + {
> + sys_cfg_path = NULL;
> + svn_error_clear(error);
> + }
> + else
> + return error;
> }
> else
> sys_cfg_path = NULL;
Received on 2009-06-16 19:22:10 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.