1
0
mirror of https://github.com/systemd/systemd synced 2026-03-23 07:14:53 +01:00

Compare commits

..

No commits in common. "b34a4f0e6729de292cb3b0c03c1d48f246ad896b" and "b838bc11268ea461e8c58ce69e2f781be1821aa1" have entirely different histories.

2 changed files with 11 additions and 7 deletions

View File

@ -1303,6 +1303,7 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:*
# Keymaps MSI Prestige And MSI Modern FnKeys and Special keys # Keymaps MSI Prestige And MSI Modern FnKeys and Special keys
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Prestige*:* evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Prestige*:*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Modern*:* evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Modern*:*
KEYBOARD_KEY_56=backslash # Secondary backslash key
KEYBOARD_KEY_f1=f20 # Fn+F5 Micmute KEYBOARD_KEY_f1=f20 # Fn+F5 Micmute
KEYBOARD_KEY_76=f21 # Fn+F4 Toggle touchpad, sends meta+ctrl+toggle KEYBOARD_KEY_76=f21 # Fn+F4 Toggle touchpad, sends meta+ctrl+toggle
KEYBOARD_KEY_91=prog1 # Fn+F7 Creation Center, sometime F7 KEYBOARD_KEY_91=prog1 # Fn+F7 Creation Center, sometime F7

View File

@ -378,13 +378,12 @@ int unit_name_unescape(const char *f, char **ret) {
} }
int unit_name_path_escape(const char *f, char **ret) { int unit_name_path_escape(const char *f, char **ret) {
_cleanup_free_ char *p = NULL; char *p, *s;
char *s;
assert(f); assert(f);
assert(ret); assert(ret);
p = strdup(f); p = strdupa(f);
if (!p) if (!p)
return -ENOMEM; return -ENOMEM;
@ -396,9 +395,13 @@ int unit_name_path_escape(const char *f, char **ret) {
if (!path_is_normalized(p)) if (!path_is_normalized(p))
return -EINVAL; return -EINVAL;
/* Truncate trailing slashes and skip leading slashes */ /* Truncate trailing slashes */
delete_trailing_chars(p, "/"); delete_trailing_chars(p, "/");
s = unit_name_escape(skip_leading_chars(p, "/"));
/* Truncate leading slashes */
p = skip_leading_chars(p, "/");
s = unit_name_escape(p);
} }
if (!s) if (!s)
return -ENOMEM; return -ENOMEM;
@ -528,7 +531,7 @@ int unit_name_from_path(const char *path, const char *suffix, char **ret) {
if (strlen(s) >= UNIT_NAME_MAX) /* Return a slightly more descriptive error for this specific condition */ if (strlen(s) >= UNIT_NAME_MAX) /* Return a slightly more descriptive error for this specific condition */
return -ENAMETOOLONG; return -ENAMETOOLONG;
/* Refuse if this for some other reason didn't result in a valid name */ /* Refuse this if this got too long or for some other reason didn't result in a valid name */
if (!unit_name_is_valid(s, UNIT_NAME_PLAIN)) if (!unit_name_is_valid(s, UNIT_NAME_PLAIN))
return -EINVAL; return -EINVAL;
@ -562,7 +565,7 @@ int unit_name_from_path_instance(const char *prefix, const char *path, const cha
if (strlen(s) >= UNIT_NAME_MAX) /* Return a slightly more descriptive error for this specific condition */ if (strlen(s) >= UNIT_NAME_MAX) /* Return a slightly more descriptive error for this specific condition */
return -ENAMETOOLONG; return -ENAMETOOLONG;
/* Refuse if this for some other reason didn't result in a valid name */ /* Refuse this if this got too long or for some other reason didn't result in a valid name */
if (!unit_name_is_valid(s, UNIT_NAME_INSTANCE)) if (!unit_name_is_valid(s, UNIT_NAME_INSTANCE))
return -EINVAL; return -EINVAL;