editorial
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 26 Oct 2022 01:00:27 +0000 (12:00 +1100)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 26 Oct 2022 01:00:27 +0000 (12:00 +1100)
libpathmap-0.c

index 56280309e5b16990d31bcb24386b60b2762b5581..b327bb98f517ccfc936ff41baecee986dbca0c52 100644 (file)
@@ -22,7 +22,7 @@
  * Pathnames are passed in to the library via the environment variable
  * PATHMAPNOT as a colon separated list of pathnames that are not to
  * be mapped. The first value of PATHMAPNOT is used as prefix to add
- * to all paths except the ones in the list (the first inlcuded).
+ * to all paths except the ones in the list (the first included).
  *
  * The given pathnames are loaded into a sorted table, offering
  * O[log(n)] lookup complexity, and the map prefix is also held
@@ -106,9 +106,10 @@ static int binsearch(const char *path) {
 }
 
 // Utility function to lookup a matching prefix for the given path. If
-// one is found, then 0 is returned. Otherwise memory is allocated for
-// a new string that consists of the root path followed by the given
-// path.
+// none is found, then 0 is returned. Otherwise memory is allocated
+// (malloc) for a new string that consists of the root path followed
+// by the given path. Note that prefixing only applies to absolute
+// paths.
 static char *maybe_add_prefix(const char *path) {
     fprintf( stderr, "libpathmap: check %s\n", path );
     if ( prefix.count > 0 && *path == '/' ) {