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 Hudson <gh...@MIT.EDU> on 2004/12/15 20:35:42 UTC

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

On Fri, 2004-12-10 at 13:50, kfogel@tigris.org wrote:
> +      /* Split 'url' to get the parent, but split 'path_or_url' to get
> +         the basename.  We're going to use the former as a URL, but
> +         the latter as a non-URL.  If any URI-encoding happened in the
> +         earlier conversion from 'path_or_url' to 'url', we want the
> +         effects reflected in 'parent_url' but not in 'base_name'. */
> +      svn_path_split (url, &parent_url, NULL, pool);
> +      svn_path_split (path_or_url, NULL, &base_name, pool);

If path_or_url is a URL, won't it (at least potentially) contain encoded
characters right from the get go?

In other words, won't

  svn ls -v http://.../path/to/foo%20bar

still fail with this fix?


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by Greg Hudson <gh...@MIT.EDU>.
On Thu, 2004-12-16 at 16:03, kfogel@collab.net wrote:
>    +      if (svn_path_is_url (path_or_url))
>    +        base_name = svn_path_uri_decode (base_name);

> Does this seem right to you?

Yes.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by kf...@collab.net.
Greg Hudson <gh...@MIT.EDU> writes:
> On Fri, 2004-12-10 at 13:50, kfogel@tigris.org wrote:
> > +      /* Split 'url' to get the parent, but split 'path_or_url' to get
> > +         the basename.  We're going to use the former as a URL, but
> > +         the latter as a non-URL.  If any URI-encoding happened in the
> > +         earlier conversion from 'path_or_url' to 'url', we want the
> > +         effects reflected in 'parent_url' but not in 'base_name'. */
> > +      svn_path_split (url, &parent_url, NULL, pool);
> > +      svn_path_split (path_or_url, NULL, &base_name, pool);
> 
> If path_or_url is a URL, won't it (at least potentially) contain encoded
> characters right from the get go?
> 
> In other words, won't
> 
>   svn ls -v http://.../path/to/foo%20bar
> 
> still fail with this fix?

Nice catch.  Yes, r12273 fixed one kind of bug, but not another.  I
think the solution is simple, though:

   Index: subversion/libsvn_client/ls.c
   ===================================================================
   --- subversion/libsvn_client/ls.c       (revision 12333)
   +++ subversion/libsvn_client/ls.c       (working copy)
   @@ -118,6 +118,8 @@
             effects reflected in 'parent_url' but not in 'base_name'. */
          svn_path_split (url, &parent_url, NULL, pool);
          svn_path_split (path_or_url, NULL, &base_name, pool);
   +      if (svn_path_is_url (path_or_url))
   +        base_name = svn_path_uri_decode (base_name);
    
          /* Re-open the session to the file's parent instead. */
          SVN_ERR (svn_client__open_ra_session (&session, ra_lib, parent_url,

Does this seem right to you?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org