[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] Clarify doc string of svn_path_is_child()

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-09-03 19:33:38 CEST

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

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.