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

Re: [PATCH] svn_path_canonicalize updated

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2001-09-20 14:34:47 CEST

 
> > A relative URL with "//" present will throw this off.
>
> how should i tell the difference between an absolute url and a
> relative url? i suppose i could do a direct compare against http://
> https:// and file://, but that seems ugly...

i still have to think about this more, but how about advancing up to
the : (if there is one), and then skipping the // (if there is one),
then treat the rest normally?

(completely untested...)

char *tmp;

tmp = strstr(path->data, ":");
if (tmp = NULL)
  tmp = path->data;

if (*tmp == '/' && *(tmp + 1) == '/')
  tmp += 2;

/* now continue normally... */

i'll have to think more about this after work...

-- 
garrett rooney                     Unix was not designed to stop you from 
rooneg@electricjellyfish.net       doing stupid things, because that would  
http://electricjellyfish.net/      stop you from doing clever things.
---------------------------------------------------------------------
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:42 2006

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