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

Re: path canonicalization problem (issue #559)

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-01-22 00:52:48 CET

I think I can agree with this. It's just that even delegating path
conversion (and canonicalization) to APR would take a lot of effort --
the APIs there are somewhat limited. Let's take things one step at a time.

    Brane

William Uther wrote:

>On 20/1/02 10:55 AM, "cmpilato@collab.net" <cmpilato@collab.net> wrote:
>
>>Garrett Rooney <rooneg@electricjellyfish.net> writes:
>>
>>>i did a little poking around with this a few days ago, and it's not
>>>promising...
>>>
>>>now that we've removed the path types, we're back to the problem that
>>>we pass quite a few url's into svn_path_canonicalize, and we don't
>>>have any way to determine how to handle them. removing extraneous .'s
>>>and ..'s isn't too hard, but removing redundant /'s is a bitch,
>>>because we have to be sure not to wipe out the // in the urls.
>>>
>>>if anyone has a good solution for this, i'd love to hear it. i don't
>>>want to return to passing path types into all the svn_path functions,
>>>and having some kind of heuristic to determine what to remove and what
>>>to leave just seems clunky and prone to failure.
>>>
>>I don't know if it's a *good* solution, but svn_path_canonicalize
>>could start calling svn_path_is_url() (which itself can use some
>>maturing) to test for URL-ness. Once URL-ness is discovered, the
>>simple rule could be that we will never remove any of the first three
>>'/'s in the path:
>>
>> <scheme>://<optional_server>/path/on/server
>> | |
>> +------- "safe zone" -------+
>>
>
>Hi,
> Just a comment from the sidelines you should feel free to ignore if you
>choose...
>
>Why are you canonicalizing paths at all? If you really need to, shouldn't
>this be done inside APR?
>
>My reason for mentioning this is that, e.g. Java, tries to abstract paths
>across OS's, but does not do a wonderful job. Examples (which may or may
>not be relevant to subversion):
>
>On MacOS (Pre X), relative paths start with a path separator, absolute paths
>start without one.
>
>On MacOS (Pre X), . and .. mean nothing special. They could be the names of
>files.
>
>On MacOS (Pre X), two path separators in a row refers to the parent
>directory.
>
>If you just view paths as things with UNIX semantics modulo prefix and path
>separator then you'll have problems moving to some platforms. In fact, the
>mac java implementation (Pre X) implemented UNIX paths rather than try to
>deal with Sun's "Cross Platform" solution with MacOS paths.
>
>Separating path and URL types seems like a good idea. URL's are also nice
>because they have a well defined semantics across platforms, which paths
>seem to lack.
>
>Later, (and thankyou for subversion :)
>
>\x/ill :-}
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: dev-help@subversion.tigris.org
>

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:57 2006

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.