summaryrefslogtreecommitdiff
path: root/src/unit-name.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-10-20 16:16:45 +0200
committerLennart Poettering <lennart@poettering.net>2010-10-20 16:16:45 +0200
commit9fc507041eb524799a0410839e961ec188a78491 (patch)
tree029b0dee9d8d382b5abc5d7a4aa4078b9033a1a6 /src/unit-name.c
parent980d87505c391682c7d9da2d48a1ba68f35c0339 (diff)
unit: introduce %f specifier to decode file names
Diffstat (limited to 'src/unit-name.c')
-rw-r--r--src/unit-name.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/unit-name.c b/src/unit-name.c
index dbaa4a7b12..d0cfca6254 100644
--- a/src/unit-name.c
+++ b/src/unit-name.c
@@ -427,3 +427,26 @@ char *unit_name_to_path(const char *name) {
return e;
}
+
+char *unit_name_path_unescape(const char *f) {
+ char *e;
+
+ assert(f);
+
+ if (!(e = unit_name_unescape(f)))
+ return NULL;
+
+ if (e[0] != '/') {
+ char *w;
+
+ w = strappend("/", e);
+ free(e);
+
+ if (!w)
+ return NULL;
+
+ e = w;
+ }
+
+ return e;
+}