diff --git a/src/basic/path-util.c b/src/basic/path-util.c index e5afb5f5f5..4aebb6541e 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -466,8 +466,10 @@ char *path_startswith_full(const char *path, const char *prefix, bool accept_dot int path_compare(const char *a, const char *b) { int r; - assert(a); - assert(b); + /* Order NULL before non-NULL */ + r = CMP(!!a, !!b); + if (r != 0) + return r; /* A relative path and an absolute path must not compare as equal. * Which one is sorted before the other does not really matter.