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

[PATCH] skip_uri_schema without strlen

From: Uwe Zeisberger <zeisberg_at_informatik.uni-freiburg.de>
Date: 2004-12-23 17:56:47 CET

Hello,

browsing subversion/libsvn_subr/path.c I found skip_uri_schema using
strlen and a comment that this is inefficient.

Moreover in my opinion the function is broken. If path == "file://" it
returns NULL instead of path + 7 because j only loops to < len - 3. Is
should loop to <= len - 3.

Here is a patch which makes skip_uri_schema behave like `<= len - 3' and
which doesn't use strlen. In my eyes it is simpler, too.

It passes `make check'.

{{{
* subversion/libsvn_subr/path.c
  (skip_uri_schema): Rewrite. Now it doesn't use strlen anymore.
  The old version was broken if path ends with "://"

* subversion/tests/libsvn_subr/path-test.c
  (test_is_url): add to test cases and calculate the length of the list
  to test instead of hard coding it.
}}}

-- 
Uwe Zeisberger
http://www.google.com/search?q=the+speed+of+light+in+m%2Fs

Received on Thu Dec 23 17:58:01 2004

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.