"priority" is now an unsigned short and the behaviour of integers
outside that range is sensible and documented.
Signed-off-by: NeilBrown <neil@brown.name>
to highlight directories in a file listing. Properties 100-199 are for
fairly stable results of analysing the document, such as spelling
errors. Properties 200-299 are for less stable results like search
-results of a selection.
+results of a selection. Priorities larger than 65534 are all treated
+identically, as are priorities less than 1.
Importantly and attribute which affects spacing, like 'tab' or 'centre'
and which cannot be closed and re-opened must have priority of 0.
struct attr_stack *next;
char *attr safe;
int end;
- short priority;
+ unsigned short priority;
} *ast, *tmpst;
int min_end;
int chars;
if (end == 0 || INT_MAX - end <= ar->chars)
end = INT_MAX - 1 - ar->chars;
new->end = ar->chars + end;
+ if (prio < 0)
+ prio = 0;
+ if (prio > 65535)
+ prio = 65535;
new->priority = prio;
*here = new;
}