Author: rhuijben
Date: Wed Jun 6 07:32:44 2012
New Revision: 1346765
URL: http://svn.apache.org/viewvc?rev=1346765&view=rev
Log:
* subversion/libsvn_subr/opt.c
(svn_opt__arg_canonicalize_url): Allow '\' inside urls on Windows, when
passed as an argument to a tool. This used to be handled when we only
used a single api for urls, paths, fspaths and relpaths.
Modified:
subversion/trunk/subversion/libsvn_subr/opt.c
Modified: subversion/trunk/subversion/libsvn_subr/opt.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/opt.c?rev=1346765&r1=1346764&r2=1346765&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/opt.c (original)
+++ subversion/trunk/subversion/libsvn_subr/opt.c Wed Jun 6 07:32:44 2012
@@ -1041,6 +1041,20 @@ svn_opt__arg_canonicalize_url(const char
/* Auto-escape some ASCII characters. */
target = svn_path_uri_autoescape(target, pool);
+#if '/' != SVN_PATH_LOCAL_SEPARATOR
+ /* Allow using file:///C:\users\me/repos on Windows, like we did in 1.6 */
+ if (strchr(target, SVN_PATH_LOCAL_SEPARATOR))
+ {
+ char *p = apr_pstrdup(pool, target);
+ target = p;
+
+ /* Convert all local-style separators to the canonical ones. */
+ for (; *p != '\0'; ++p)
+ if (*p == SVN_PATH_LOCAL_SEPARATOR)
+ *p = '/';
+ }
+#endif
+
/* Verify that no backpaths are present in the URL. */
if (svn_path_is_backpath_present(target))
return svn_error_createf(SVN_ERR_BAD_URL, 0,