]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
report: add comment explaining that metric_startswith_prefix() does a true prefix...
authorLennart Poettering <lennart@amutable.com>
Thu, 19 Feb 2026 07:47:51 +0000 (08:47 +0100)
committerLennart Poettering <lennart@amutable.com>
Fri, 20 Feb 2026 07:15:30 +0000 (08:15 +0100)
src/report/report.c

index e038d4fa5b9567a0780ee9643d683674c97e5a06..ab13ae905bf1c6c7017f3099feb6802e1ef503fa 100644 (file)
@@ -103,6 +103,9 @@ static inline bool metric_startswith_prefix(const char *metric_name, const char
         if (isempty(metric_name) || isempty(prefix))
                 return false;
 
+        /* NB: this checks for a *true* prefix, i.e. insists on the dot separator after the prefix. Or in
+         * other words, "foo" is not going to be considered a prefix of "foo", but of "foo.bar" it will. */
+
         const char *m = startswith(metric_name, prefix);
         return !isempty(m) && m[0] == '.';
 }