mcstransd select correct colour range.

mcstransd: Now selects the range color for a matching 'range' entry in secolor.conf file, and not the first range to pass the dominance check.

The second patch has the man pages to support the colour functions that match how mcstransd manages colour selection.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
Signed-off-by: Steve Lawrence <slawrence@tresys.com>
This commit is contained in:
Richard Haines 2011-04-10 17:18:28 +01:00 committed by Steve Lawrence
parent 20b43b3fd3
commit fe17b3d2d9

View File

@ -135,12 +135,12 @@ static const secolor_t *find_color(int idx, const char *component,
}
while (ptr) {
if (idx == COLOR_RANGE) {
if (check_dominance(ptr->pattern, raw) == 0)
return &ptr->color;
} else {
if (fnmatch(ptr->pattern, component, 0) == 0)
return &ptr->color;
if (fnmatch(ptr->pattern, component, 0) == 0) {
if (idx == COLOR_RANGE) {
if (check_dominance(ptr->pattern, raw) == 0)
return &ptr->color;
} else
return &ptr->color;
}
ptr = ptr->next;
}