You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2010/03/01 15:28:11 UTC

svn commit: r917548 - /subversion/trunk/subversion/libsvn_subr/dirent_uri.c

Author: julianfoad
Date: Mon Mar  1 14:28:11 2010
New Revision: 917548

URL: http://svn.apache.org/viewvc?rev=917548&view=rev
Log:
Tweak implementation comments, and remove a redundant initialization.

* subversion/libsvn_subr/dirent_uri.c
  (canonicalize): Fix the doc string. (It accepts all three types, not just
    the two it mentioned.) Add some internal explanatory comments. Remove a
    redundant initialization.

Modified:
    subversion/trunk/subversion/libsvn_subr/dirent_uri.c

Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=917548&r1=917547&r2=917548&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Mon Mar  1 14:28:11 2010
@@ -332,9 +332,8 @@
   return i;
 }
 
-/* Return the canonicalized version of PATH, allocated in POOL.
- * Pass type_uri for TYPE if PATH is a uri and type_dirent if PATH
- * is a regular path.
+/* Return the canonicalized version of PATH, of type TYPE, allocated in
+ * POOL.
  */
 static const char *
 canonicalize(path_type_t type, const char *path, apr_pool_t *pool)
@@ -353,10 +352,9 @@
 
   dst = canon = apr_pcalloc(pool, strlen(path) + 1);
 
-  /* Try to parse the path as an URI. */
-  url = FALSE;
+  /* If this is supposed to be an URI and it starts with "scheme://", then
+     copy the scheme, host name, etc. to DST and set URL = TRUE. */
   src = path;
-
   if (type == type_uri && *src != '/')
     {
       while (*src && (*src != '/') && (*src != ':'))
@@ -416,6 +414,8 @@
         }
     }
 
+  /* Copy to DST any separator or drive letter that must come before the
+     first regular path segment. */
   if (! url && type != type_relpath)
     {
       src = path;
@@ -441,6 +441,9 @@
                (src[1] == ':'))
         {
           *(dst++) = canonicalize_to_upper(*(src++));
+          /* Leave the ':' to be processed as (or as part of) a path segment
+             by the following code block, so we need not care whether it has
+             a slash after it. */
         }
 #endif
     }