~ubuntu-branches/ubuntu/raring/postfix/raring

« back to all changes in this revision

Viewing changes to src/util/match_list.c

Tags: upstream-2.2.6
ImportĀ upstreamĀ versionĀ 2.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    const char **match_args;            /* match arguments */
96
96
};
97
97
 
 
98
#define MATCH_DICTIONARY(pattern) \
 
99
    ((pattern)[0] != '[' && strchr((pattern), ':') != 0)
 
100
 
98
101
/* match_list_parse - parse buffer, destroy buffer */
99
102
 
100
103
static ARGV *match_list_parse(ARGV *list, char *string)
125
128
                    list = match_list_parse(list, vstring_str(buf));
126
129
            if (vstream_fclose(fp))
127
130
                msg_fatal("%s: read file %s: %m", myname, pattern);
128
 
        } else if (strchr(pattern, ':') != 0) { /* type:table */
 
131
        } else if (MATCH_DICTIONARY(pattern)) { /* type:table */
129
132
            if (buf == 0)
130
133
                buf = vstring_alloc(10);
131
134
#define OPEN_FLAGS      O_RDONLY
137
140
            map_type_name_flags = STR(buf) + (map_type_name - pattern);
138
141
            if (dict_handle(map_type_name_flags) == 0)
139
142
                dict_register(map_type_name_flags,
140
 
                              dict_open(map_type_name, OPEN_FLAGS, DICT_FLAGS));
 
143
                          dict_open(map_type_name, OPEN_FLAGS, DICT_FLAGS));
141
144
            argv_add(list, STR(buf), (char *) 0);
142
145
        } else {                                /* other pattern */
143
146
            argv_add(list, pattern, (char *) 0);