diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-26 13:21:41 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-26 13:21:41 +0100 |
commit | ad1a44b23bbc909aa3f5876dadd482a9f6c18d5c (patch) | |
tree | 97fc092ae75eddafb746b58d2254c6af953f1e9e /src/basic/path-util.c | |
parent | 0dec689b098cf62b948d43dc78bde859665056ec (diff) | |
parent | 4d0d3d41d21f34f28ee67b8b1952af88ada7abaf (diff) |
Merge pull request #1676 from poettering/util-lib-2
split up util.[ch] into more pieces, and other stuff
Diffstat (limited to 'src/basic/path-util.c')
-rw-r--r-- | src/basic/path-util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 7b01633f5f..0b8cac8f3e 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -428,7 +428,7 @@ int path_compare(const char *a, const char *b) { * Which one is sorted before the other does not really matter. * Here a relative path is ordered before an absolute path. */ d = (a[0] == '/') - (b[0] == '/'); - if (d) + if (d != 0) return d; for (;;) { @@ -451,12 +451,12 @@ int path_compare(const char *a, const char *b) { /* Alphabetical sort: "/foo/aaa" before "/foo/b" */ d = memcmp(a, b, MIN(j, k)); - if (d) + if (d != 0) return (d > 0) - (d < 0); /* sign of d */ /* Sort "/foo/a" before "/foo/aaa" */ d = (j > k) - (j < k); /* sign of (j - k) */ - if (d) + if (d != 0) return d; a += j; |