summaryrefslogtreecommitdiff
path: root/namedev_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'namedev_parse.c')
-rw-r--r--namedev_parse.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/namedev_parse.c b/namedev_parse.c
index 20ff60d640..d5d2181cb6 100644
--- a/namedev_parse.c
+++ b/namedev_parse.c
@@ -91,13 +91,6 @@ static char *get_key_attribute(char *str)
char *pos;
char *attr;
- attr = strchr(str, '_');
- if (attr != NULL) {
- attr++;
- dbg("attribute='%s'", attr);
- return attr;
- }
-
attr = strchr(str, '{');
if (attr != NULL) {
attr++;
@@ -111,6 +104,13 @@ static char *get_key_attribute(char *str)
return attr;
}
+ attr = strchr(str, '_');
+ if (attr != NULL) {
+ attr++;
+ dbg("attribute='%s'", attr);
+ return attr;
+ }
+
return NULL;
}
@@ -221,7 +221,13 @@ int namedev_init_rules(void)
continue;
}
- if (strcasecmp(temp2, FIELD_NAME) == 0) {
+ if (strncasecmp(temp2, FIELD_NAME, sizeof(FIELD_NAME)-1) == 0) {
+ attr = get_key_attribute(temp2 + sizeof(FIELD_NAME)-1);
+ if (attr != NULL)
+ if (strcasecmp(attr, ATTR_PARTITIONS) == 0) {
+ dbg_parse("creation of partition nodes requested");
+ dev.partitions = PARTITIONS_COUNT;
+ }
strfieldcpy(dev.name, temp3);
continue;
}