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

Re: svn commit: r29239 - trunk/subversion/libsvn_client

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Mon, 11 Feb 2008 14:06:29 -0500

Paul Burba wrote:
>>> @@ -3814,7 +3814,8 @@
>>> {
>>> svn_location_segment_t *new_segment =
>>> apr_pcalloc(pool, sizeof(*new_segment));
>>> - new_segment->path = copyfrom_path;
>>> + /* Skip the leading '/'. */
>>> + new_segment->path = copyfrom_path + 1;
>>> new_segment->range_start = copyfrom_rev;
>>> new_segment->range_end = copyfrom_rev;
>>> segment->range_start = copyfrom_rev + 1;
>> It's not possible for copyfrom_path to be "", right?
>
> Are you thinking we could end up with "" rather than "/"? If so, I
> don't see how that is possible, maybe I'm missing something, but how
> can you copy the root of a repository (which is obviously required for
> it to be a copy source)?

The root can certainly be the source of a copy. Our client libraries
disallow copying a path into a child of itself, but IIRC the filesystem
libraries allow as much.

> Regardless, we should probably should check for the leading '/'.

Yep. We need something like:

    (*copyfrom_path == '/') ? copyfrom_path + 1 : copyfrom_path;

or:

    copyfrom_path + ((*copyfrom_path == '/') ? 1 : 0);

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-02-11 20:06:52 CET

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.