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

Re: [PATCH] svn_repos_create should allow fs_config being null

From: Daniel L. Rall <dlr_at_finemaltcoding.com>
Date: 2005-09-30 03:45:46 CEST

That would leave repos->fs_type uninitialized if fs_config was NULL. How
about this?

--- subversion/libsvn_repos/repos.c (revision 16360)
+++ subversion/libsvn_repos/repos.c (working copy)
@@ -1545,6 +1545,7 @@
   repos->conf_path = svn_path_join (path, SVN_REPOS__CONF_DIR, pool);
   repos->hook_path = svn_path_join (path, SVN_REPOS__HOOK_DIR, pool);
   repos->lock_path = svn_path_join (path, SVN_REPOS__LOCK_DIR, pool);
+ repos->fs_type = DEFAULT_FS_TYPE;
 
   return repos;
 }
@@ -1659,16 +1660,18 @@
 {
   svn_repos_t *repos;
   svn_error_t *err;
+ const char *cfg_fs_type = NULL;
 
   /* Allocate a repository object, filling in the format we will create. */
   repos = create_svn_repos_t (path, pool);
   repos->format = SVN_REPOS__FORMAT_NUMBER;
 
   /* Discover the type of the filesystem we are about to create. */
- repos->fs_type = apr_hash_get (fs_config, SVN_FS_CONFIG_FS_TYPE,
- APR_HASH_KEY_STRING);
- if (! repos->fs_type)
- repos->fs_type = DEFAULT_FS_TYPE;
+ if (fs_config)
+ cfg_fs_type = apr_hash_get (fs_config, SVN_FS_CONFIG_FS_TYPE,
+ APR_HASH_KEY_STRING);
+ if (cfg_fs_type)
+ repos->fs_type = cfg_fs_type;
 
   /* Create the various files and subdirectories for the repository. */
   SVN_ERR_W (create_repos_structure (repos, path, pool),

On Fri, 30 Sep 2005, Chia-liang Kao wrote:
...
> Log:
> Fix check-swig-pl failures.
>
> * libsvn_repos/repos.c:
> (svn_repos_create) Allow fs_config to be null, as svn_repos.h says so.
>
> === subversion/libsvn_repos/repos.c
> ==================================================================
> --- subversion/libsvn_repos/repos.c (revision 16360)
> +++ subversion/libsvn_repos/repos.c (patch repos-create level 1)
> @@ -1665,8 +1665,10 @@
> repos->format = SVN_REPOS__FORMAT_NUMBER;
>
> /* Discover the type of the filesystem we are about to create. */
> - repos->fs_type = apr_hash_get (fs_config, SVN_FS_CONFIG_FS_TYPE,
> - APR_HASH_KEY_STRING);
> + if (fs_config) {
> + repos->fs_type = apr_hash_get (fs_config, SVN_FS_CONFIG_FS_TYPE,
> + APR_HASH_KEY_STRING);
> + }
> if (! repos->fs_type)
> repos->fs_type = DEFAULT_FS_TYPE;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Sep 30 03:46:52 2005

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.