On Tue, Aug 06, 2002 at 12:01:17AM -0500, sussman@tigris.org wrote:
> @@ -815,6 +815,10 @@
> const char *fs_path;
> const char *repo_name;
> const char *xslt_uri;
> + const char *fs_parent_path;
> + const char *true_root_path;
> + const char *true_fs_path;
> + const char *true_relative_path;
Just to point out, it probably would have been better if you
updated root_path, fs_path, and relative_path in the SVNParentPath
case rather than declare new variables. It certainly would have
made the patch a lot smaller. You would have contained the
scope of your changes to just the else part.
> + else if (fs_parent_path != NULL)
> + {
> + /* SVNParentPath was used: assume the first component of
> + 'relative' is the name of a repository. */
> + const char *magic_component;
> + int i;
> + apr_size_t len = strlen(relative);
> +
> + for (i = 1; i < len; i++)
> + {
> + if (relative[i] == '/')
> + break;
> + }
> +
> + magic_component = apr_pstrndup(r->pool, relative + 1, i - 1);
> +
> + true_relative_path = relative + i;
> + true_root_path = svn_path_join (root_path, magic_component, r->pool);
> + true_fs_path = svn_path_join (fs_parent_path, magic_component, r->pool);
> + }
> +
> +
What is the rationale for not using strchr here? That'd be way simpler
to deal with, wouldn't it?
Pseudo-code:
char *foo = strchr(relative + 1, '/');
if (foo) // we have a match
magic_component = apr_pstrmemdup(r->pool, relative + 1,
foo - relative + 1);
else // no match.
magic_component = relative + 1;
foo = "/";
true_relative_path = foo;
true_root_path = svn_path_join(root_path, magic_component, r->pool);
true_fs_path = svn_path_join(fs_parent_path, magic_component, r->pool);
Note that I set foo to be "/" as to mimic the check on repos.c:907.
HTH. -- justin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 6 09:47:57 2002