[systemd-devel] [PATCH 1/2] path-util: add path_make_relative()
Lennart Poettering
lennart at poettering.net
Fri May 16 09:46:46 PDT 2014
On Sat, 03.05.14 11:52, Tanu Kaskinen (tanu.kaskinen at linux.intel.com) wrote:
> In user_dirs() in path-lookup.c, I want to replace this:
> symlink("../../../.config/systemd/user", data_home);
> with
> symlink(config_home, data_home);
> to avoid hardcoding .config when XDG_CONFIG_HOME is set.
>
> The problem is that config_home is an absolute path, and it's better
> to make the symlink relative. path_make_relative() is an utility
> function that converts an absolute path into a relative one.
Sounds very useful, but I think for things like this it would be good to
have a test case? Sounds awfully hard to make sure this works correctly
without actually testing this...
Patch looks pretty good otherwise!
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list