svn_path_is_child() determines whether one path is a child of another, and
returns the extra portion if so. It wasn't clear what this function would make
of a potentially-child path which is identical to the parent path. I rather
assumed it would say, "Yes, it's a child; the child part is the empty string,"
but it doesn't, it returns null. This patch clarifies the behaviour.
OK to commit it?
- Julian
Clarify a doc string.
* subversion/include/svn_path.h
(svn_path_is_child): Make the doc string more explicit.
Index: subversion/include/svn_path.h
===================================================================
--- subversion/include/svn_path.h (revision 16034)
+++ subversion/include/svn_path.h (working copy)
@@ -351,6 +351,9 @@ svn_boolean_t svn_path_is_backpath_prese
* Both paths must be in canonical form, and must either be absolute,
* or contain no ".." components.
*
+ * If @a path2 is the same as @a path1, it is not a child, so the
+ * result is @c NULL; an empty string is never returned.
+ *
* ### todo: the ".." restriction is unfortunate, and would ideally
* be lifted by making the implementation smarter. But this is not
* trivial: if the path is "../foo", how do you know whether or not
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Sep 3 19:34:48 2005