chiark / gitweb /
udev: expose network interfaces by default
[elogind.git] / unit-name.c
index 219997b681579581b69b7c955707f125770c9c93..5053d30f29a4721a6b5b43671a8400cacff93de8 100644 (file)
@@ -29,7 +29,7 @@
         "0123456789"                            \
         "abcdefghijklmnopqrstuvwxyz"            \
         "ABCDEFGHIJKLMNOPQRSTUVWXYZ"            \
-        "-_.\\"
+        ":-_.\\"
 
 UnitType unit_name_to_type(const char *n) {
         UnitType t;
@@ -207,8 +207,8 @@ static char* do_escape(const char *f, char *t) {
 
         for (; *f; f++) {
                 if (*f == '/')
-                        *(t++) = '.';
-                else if (*f == '.' || *f == '\\' || !strchr(VALID_CHARS, *f)) {
+                        *(t++) = '-';
+                else if (*f == '-' || *f == '\\' || !strchr(VALID_CHARS, *f)) {
                         *(t++) = '\\';
                         *(t++) = 'x';
                         *(t++) = hexchar(*f > 4);
@@ -286,7 +286,7 @@ char *unit_name_unescape(const char *f) {
                 return NULL;
 
         for (t = r; *f; f++) {
-                if (*f == '.')
+                if (*f == '-')
                         *(t++) = '/';
                 else if (*f == '\\') {
                         int a, b;