chiark / gitweb /
Prep v232: Do not listen to SYSTEMD_* environment variables to override things.
[elogind.git] / src / basic / path-util.c
index cdbb2d39815f349fd4736fcb05e639126935a312..8cb013e6cb2beea724909568d0ca6bed93a55045 100644 (file)
@@ -356,6 +356,16 @@ char* path_startswith(const char *path, const char *prefix) {
         assert(path);
         assert(prefix);
 
+        /* Returns a pointer to the start of the first component after the parts matched by
+         * the prefix, iff
+         * - both paths are absolute or both paths are relative,
+         * and
+         * - each component in prefix in turn matches a component in path at the same position.
+         * An empty string will be returned when the prefix and path are equivalent.
+         *
+         * Returns NULL otherwise.
+         */
+
         if ((path[0] == '/') != (prefix[0] == '/'))
                 return NULL;
 
@@ -824,7 +834,6 @@ bool is_deviceallow_pattern(const char *path) {
                startswith(path, "block-") ||
                startswith(path, "char-");
 }
-#endif // 0
 
 int systemd_installation_has_version(const char *root, unsigned minimal_version) {
         const char *pattern;
@@ -891,3 +900,4 @@ int systemd_installation_has_version(const char *root, unsigned minimal_version)
 
         return false;
 }
+#endif // 0