subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r917548 - /subversion/trunk/subversion/libsvn_subr/dirent_uri.c
Date Mon, 01 Mar 2010 14:28:11 GMT
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
     }



Mime
View raw message