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

[PATCH] Clarify svn_path_is_child() result when child==parent

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-09-05 17:54:20 CEST

I'm posting this for review because this function says that "child == parent"
is not a child whereas I would have expected the opposite behaviour: saying it
IS a child, of length zero. I think it's too late to change it, and we might
not want to anyway, so we should just document it, as this patch does.

Agreements or other thoughts?

- Julian

Clarify a doc string.

* subversion/include/svn_path.h
  (svn_path_is_child): Explicitly document the result when the path being
    tested is identical to the parent path.

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 considered 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 Mon Sep 5 17:55:04 2005

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