summaryrefslogtreecommitdiff
path: root/udev/udev-rules.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-23 02:57:08 +0200
committerKay Sievers <kay.sievers@vrfy.org>2008-10-23 02:57:08 +0200
commitb99028c96307e729303be8f6750418979a7488b9 (patch)
tree692f8b651631ed42ee87d4f1b565efd01b12dc1f /udev/udev-rules.c
parent40fd3bc837e04538df305b512157e55a2a5e0789 (diff)
shrink struct udev_event
Diffstat (limited to 'udev/udev-rules.c')
-rw-r--r--udev/udev-rules.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 675a7f0625..19ee06d379 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -1952,6 +1952,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
case TK_A_NAME:
{
const char *name = &rules->buf[cur->key.value_off];
+ char name_str[UTIL_PATH_SIZE];
int count;
if (event->name_final)
@@ -1959,17 +1960,17 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
if (cur->key.op == KEY_OP_ASSIGN_FINAL)
event->name_final = 1;
if (name[0] == '\0') {
- event->name[0] = '\0';
- event->name_ignore = 1;
+ free(event->name);
+ event->name = NULL;
break;
}
- event->name_ignore = 0;
- util_strlcpy(event->name, name, sizeof(event->name));
- udev_event_apply_format(event, event->name, sizeof(event->name));
+ util_strlcpy(name_str, name, sizeof(name_str));
+ udev_event_apply_format(event, name_str, sizeof(name_str));
if (esc == ESCAPE_UNSET || esc == ESCAPE_REPLACE) {
- count = util_replace_chars(event->name, ALLOWED_CHARS_FILE);
+ count = util_replace_chars(name_str, ALLOWED_CHARS_FILE);
if (count > 0)
info(event->udev, "%i character(s) replaced\n", count);
+ event->name = strdup(name_str);
}
break;
}