diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-20 23:12:22 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-20 23:12:22 +0200 |
commit | fb045134706a50f12361e37f936a87d62e757db3 (patch) | |
tree | 7d45e74c2bf8dd5752c491f9114b2b3b7f8e05bc /udev | |
parent | 690ed63a22408eea4e540bbdb5e1038df4a68df5 (diff) |
remove unused GL_FORMAT from rules parser
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-rules.c | 43 |
1 files changed, 17 insertions, 26 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 6d03ab63c0..c036482759 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -103,7 +103,6 @@ enum string_glob_type { GL_SPLIT, /* multi-value A|B */ GL_SPLIT_GLOB, /* multi-value with glob A*|B* */ GL_SOMETHING, /* commonly used "?*" */ - GL_FORMAT, }; /* tokens of a rule are sorted/handled in this order */ @@ -230,7 +229,6 @@ static const char *string_glob_str(enum string_glob_type type) [GL_SPLIT] = "split", [GL_SPLIT_GLOB] = "split-glob", [GL_SOMETHING] = "split-glob", - [GL_FORMAT] = "format", }; return string_glob_strs[type]; @@ -1056,29 +1054,23 @@ static int rule_add_key(struct rule_tmp *rule_tmp, enum token_type type, } glob = GL_PLAIN; - if (value != NULL) { - if (type < TK_M_MAX) { - /* check if we need to split or call fnmatch() while matching rules */ - int has_split; - int has_glob; - - has_split = (strchr(value, '|') != NULL); - has_glob = (strchr(value, '*') != NULL || strchr(value, '?') != NULL || - strchr(value, '[') != NULL || strchr(value, ']') != NULL); - if (has_split && has_glob) { - glob = GL_SPLIT_GLOB; - } else if (has_split) { - glob = GL_SPLIT; - } else if (has_glob) { - if (strcmp(value, "?*") == 0) - glob = GL_SOMETHING; - else - glob = GL_GLOB; - } - } else { - /* check if we need to substitute format strings for matching rules */ - if (strchr(value, '%') != NULL || strchr(value, '$') != NULL) - glob = GL_FORMAT; + if (value != NULL && type < TK_M_MAX) { + /* check if we need to split or call fnmatch() while matching rules */ + int has_split; + int has_glob; + + has_split = (strchr(value, '|') != NULL); + has_glob = (strchr(value, '*') != NULL || strchr(value, '?') != NULL || + strchr(value, '[') != NULL || strchr(value, ']') != NULL); + if (has_split && has_glob) { + glob = GL_SPLIT_GLOB; + } else if (has_split) { + glob = GL_SPLIT; + } else if (has_glob) { + if (strcmp(value, "?*") == 0) + glob = GL_SOMETHING; + else + glob = GL_GLOB; } } @@ -1901,7 +1893,6 @@ static int match_key(struct udev_rules *rules, struct token *token, const char * case GL_SOMETHING: match = (val[0] != '\0'); break; - case GL_FORMAT: case GL_UNSET: return -1; } |