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

Re: svn commit: r12099 - branches/locking/subversion/mod_dav_svn

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2004-11-30 23:16:06 CET

sussman@tigris.org writes:

> --- branches/locking/subversion/mod_dav_svn/repos.c (original)
> +++ branches/locking/subversion/mod_dav_svn/repos.c Tue Nov 30 15:56:39 2004
> @@ -1376,9 +1376,31 @@
> "software.");
> }
>

This function has no documentation.

> +
> +static const char *get_parent_path(const char *path,
> + apr_pool_t *pool)
> +{
> + apr_size_t len;
> + const char *parentpath, *basename;
> + char *tmp = apr_pstrdup(pool, path);
> +
> + /* Remove any trailing slash; they make svn_path_split() assert and die.*/

Why are non-canonical paths being passed around?

> + len = strlen(tmp);
> + if (tmp[len-1] == '/')

Since I don't know if "" is a valid input I don't know whether [len-1]
is safe.

> + tmp[len-1] = '\0';
> +
> + svn_path_split(tmp, &parentpath, &basename, pool);
> +
> + /* ### preserve the slash on the parent?? */
> + return parentpath;
> +}
> +

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 30 23:17:14 2004

This is an archived mail posted to the Subversion Dev mailing list.