summaryrefslogtreecommitdiff
path: root/src/shared/path-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-09-14 20:02:52 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-14 20:02:52 +0200
commit424a19f8a2061c6b058283228734010b2fa24db4 (patch)
tree56b06b85c96832a319657006c660625d304c1df8 /src/shared/path-util.c
parent608da9e9b56be83ac394ea7a19cbdacab94f6642 (diff)
timedate: assorted improvements
- Make writing/reading of /etc/timezone dependendent of HAVE_SYSV_COMPAT - Introduce symlink_atomic() after all, and use it - Use relative symlink for /etc/localtime
Diffstat (limited to 'src/shared/path-util.c')
-rw-r--r--src/shared/path-util.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index b51a68d6d2..70c8a8af06 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -264,12 +264,12 @@ char *path_kill_slashes(char *path) {
return path;
}
-bool path_startswith(const char *path, const char *prefix) {
+char* path_startswith(const char *path, const char *prefix) {
assert(path);
assert(prefix);
if ((path[0] == '/') != (prefix[0] == '/'))
- return false;
+ return NULL;
for (;;) {
size_t a, b;
@@ -278,19 +278,19 @@ bool path_startswith(const char *path, const char *prefix) {
prefix += strspn(prefix, "/");
if (*prefix == 0)
- return true;
+ return (char*) path;
if (*path == 0)
- return false;
+ return NULL;
a = strcspn(path, "/");
b = strcspn(prefix, "/");
if (a != b)
- return false;
+ return NULL;
if (memcmp(path, prefix, a) != 0)
- return false;
+ return NULL;
path += a;
prefix += b;