about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.hh13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 54673c28c6af..1b0600006a29 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -60,15 +60,18 @@ extern string thisSystem;
    is also canonicalised. */
 Path absPath(Path path, Path dir = "");
 
-/* Canonicalise a path (as in realpath(3)). */
+/* Canonicalise a path by removing all `.' or `..' components and
+   double or trailing slashes. */
 Path canonPath(const Path & path);
 
-/* Return the directory part of the given path, i.e., everything
-   before the final `/'. */
+/* Return the directory part of the given canonical path, i.e.,
+   everything before the final `/'.  If the path is the root or an
+   immediate child thereof (e.g., `/foo'), this means an empty string
+   is returned. */
 Path dirOf(const Path & path);
 
-/* Return the base name of the given path, i.e., everything following
-   the final `/'. */
+/* Return the base name of the given canonical path, i.e., everything
+   following the final `/'. */
 string baseNameOf(const Path & path);
 
 /* Return true iff the given path exists. */