You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2009/03/07 13:15:15 UTC

Re: svn commit: r36383 - in trunk/subversion: libsvn_subr tests/libsvn_subr

On Sat, Mar 7, 2009 at 13:34, Bert Huijben <rh...@sharpsvn.net> wrote:
>...
> @@ -932,6 +933,15 @@ test_dirent_is_canonical(const char **ms
>                                  tests[i].path,
>                                  canonical ? "TRUE" : "FALSE",
>                                  tests[i].canonical ? "TRUE" : "FALSE");
> +
> +      canonicalized = svn_dirent_canonicalize(tests[i].path, pool);
> +
> +      if (canonical && (strcmp(tests[i].path, canonicalized) != 0))
> +        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
>...
> @@ -1035,6 +1049,16 @@ test_uri_is_canonical(const char **msg,
>                                  tests[i].path,
>                                  canonical ? "TRUE" : "FALSE",
>                                  tests[i].canonical ? "TRUE" : "FALSE");
> +
> +      canonicalized = svn_uri_canonicalize(tests[i].path, pool);
> +
> +      if (canonical != (strcmp(tests[i].path, canonicalized) == 0))
> +        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,

Why are these two checks different?


Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1282703


RE: svn commit: r36383 - in trunk/subversion: libsvn_subr tests/libsvn_subr

Posted by Bert Huijben <rh...@sharpsvn.net>.
> -----Original Message-----
> From: Greg Stein [mailto:gstein@gmail.com]
> Sent: Saturday, March 07, 2009 2:15 PM
> To: dev@subversion.tigris.org
> Subject: Re: svn commit: r36383 - in trunk/subversion: libsvn_subr
> tests/libsvn_subr
> 
> On Sat, Mar 7, 2009 at 13:34, Bert Huijben <rh...@sharpsvn.net>
> wrote:
> >...
> > @@ -932,6 +933,15 @@ test_dirent_is_canonical(const char **ms
> >                                  tests[i].path,
> >                                  canonical ? "TRUE" : "FALSE",
> >                                  tests[i].canonical ? "TRUE" :
> "FALSE");
> > +
> > +      canonicalized = svn_dirent_canonicalize(tests[i].path, pool);
> > +
> > +      if (canonical && (strcmp(tests[i].path, canonicalized) != 0))
> > +        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
> >...
> > @@ -1035,6 +1049,16 @@ test_uri_is_canonical(const char **msg,
> >                                  tests[i].path,
> >                                  canonical ? "TRUE" : "FALSE",
> >                                  tests[i].canonical ? "TRUE" :
> "FALSE");
> > +
> > +      canonicalized = svn_uri_canonicalize(tests[i].path, pool);
> > +
> > +      if (canonical != (strcmp(tests[i].path, canonicalized) == 0))
> > +        return svn_error_createf(SVN_ERR_TEST_FAILED, NULL,
> 
> Why are these two checks different?

	Thanks for noticing,

Currently the checks pass in both formats.. but I don't think we should check that canonicalizing a path can always fix a dirent when it was not canonical before.. 

In almost every case we can, but I don't think we can ever convert "a:::" into something sensible on Windows.

The current simple uri rules say we always can.. But I planned to apply the same change there, but I forgot to do that before committing.

	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1283732