Merge pull request #3962 from wkennington/master.iffix
nixos/utils: Don't remove first character if not a /
This commit is contained in:
commit
037b1cd0e9
@ -5,6 +5,7 @@ rec {
|
||||
# Escape a path according to the systemd rules, e.g. /dev/xyzzy
|
||||
# becomes dev-xyzzy. FIXME: slow.
|
||||
escapeSystemdPath = s:
|
||||
replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"] (substring 1 (stringLength s) s);
|
||||
replaceChars ["/" "-" " "] ["-" "\\x2d" "\\x20"]
|
||||
(if hasPrefix "/" s then substring 1 (stringLength s) s else s);
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user