[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 Küng <tortoisesvn_at_gmail.com>
Date: Tue, 16 Jun 2009 20:06:00 +0200

Stefan Sperling wrote:
> 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

Thanks for the review.
Corrected patch is attached.

Stefan

-- 
       ___
  oo  // \\      "De Chelonian Mobile"
 (_,\/ \_/ \     TortoiseSVN
   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2362545

[[[
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 *err = NULL;
 
   *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 ((err) && (err->apr_err == SVN_ERR_BAD_FILENAME))
+ {
+ sys_cfg_path = NULL;
+ svn_error_clear(err);
+ }
+ else
+ return err;
     }
   else
     sys_cfg_path = NULL;

Received on 2009-06-16 20:06: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.