You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David James <dj...@collab.net> on 2006/10/02 22:39:54 UTC

Re: svn commit: r21621 - in trunk/subversion: libsvn_subr tests/cmdline tests/cmdline/svntest tests/libsvn_subr

On 9/23/06, lgo@tigris.org <lg...@tigris.org> wrote:
> --- trunk/subversion/libsvn_subr/path.c (original)
> +++ trunk/subversion/libsvn_subr/path.c Sat Sep 23 08:44:04 2006
> @@ -191,7 +191,7 @@
>               the total length. */
>            total_len = len;
>            base_arg = nargs;
> -          base_is_root = len == 1;
> +          base_is_root = svn_path_is_root(s, len, pool);
>            base_is_empty = FALSE;
>          }
>        else if (nargs == base_arg
> @@ -254,7 +254,8 @@
>           (which can happen when base_arg is set). also, don't put in a slash
>           if the prior character is a slash (occurs when prior component
>           is "/"). */
> -      if (p != path && p[-1] != '/')
> +      if (p != path && p[-1] != '/' &&
> +         ! (nargs - 1 == base_arg && base_is_root))
>          *p++ = '/';
>
>        /* copy the new component and advance the pointer */

If the first arg is an UNC path, we'll want to append a slash here.
E.g., if the first component is //server/share, and the second
component is file.txt, we'll want a slash in between the two
components.

I think we should simply check for whether the first path ends with a
':' or a '/', instead of calling svn_path_is_root, because it's a more
reliable test.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r21621 - in trunk/subversion: libsvn_subr tests/cmdline tests/cmdline/svntest tests/libsvn_subr

Posted by Lieven Govaerts <lg...@mobsol.be>.
Quoting David James <dj...@collab.net>:

> On 9/23/06, lgo@tigris.org <lg...@tigris.org> wrote:
> > --- trunk/subversion/libsvn_subr/path.c (original)
> > +++ trunk/subversion/libsvn_subr/path.c Sat Sep 23 08:44:04 2006
> > @@ -191,7 +191,7 @@
> >               the total length. */
> >            total_len = len;
> >            base_arg = nargs;
> > -          base_is_root = len == 1;
> > +          base_is_root = svn_path_is_root(s, len, pool);
> >            base_is_empty = FALSE;
> >          }
> >        else if (nargs == base_arg
> > @@ -254,7 +254,8 @@
> >           (which can happen when base_arg is set). also, don't put in a
> slash
> >           if the prior character is a slash (occurs when prior component
> >           is "/"). */
> > -      if (p != path && p[-1] != '/')
> > +      if (p != path && p[-1] != '/' &&
> > +         ! (nargs - 1 == base_arg && base_is_root))
> >          *p++ = '/';
> >
> >        /* copy the new component and advance the pointer */
>
> If the first arg is an UNC path, we'll want to append a slash here.
> E.g., if the first component is //server/share, and the second
> component is file.txt, we'll want a slash in between the two
> components.
>
> I think we should simply check for whether the first path ends with a
> ':' or a '/', instead of calling svn_path_is_root, because it's a more
> reliable test.

Problem with that test for ':' is that we only have to do that on Windows, which
means we will put a lot of #ifdef's in the code. Isn't it better to improve the
performance of the svn_path_is_root function instead?

Lieven.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org