- /* Figure out what kind of a filter rule "s" is pointing at. */
- if (!(xflags & (XFLG_DEF_INCLUDE | XFLG_DEF_EXCLUDE))) {
- char *mods = "";
+ new_rflags = rflags & FILTRULES_FROM_CONTAINER;
+
+ /* Figure out what kind of a filter rule "s" is pointing at. Note
+ * that if FILTRULE_NO_PREFIXES is set, the rule is either an include
+ * or an exclude based on the inheritance of the FILTRULE_INCLUDE
+ * flag (above). XFLG_OLD_PREFIXES indicates a compatibility mode
+ * for old include/exclude patterns where just "+ " and "- " are
+ * allowed as optional prefixes. */
+ if (rflags & FILTRULE_NO_PREFIXES) {
+ if (*s == '!' && rflags & FILTRULE_CVS_IGNORE)
+ new_rflags |= FILTRULE_CLEAR_LIST; /* Tentative! */
+ } else if (xflags & XFLG_OLD_PREFIXES) {
+ if (*s == '-' && s[1] == ' ') {
+ new_rflags &= ~FILTRULE_INCLUDE;
+ s += 2;
+ } else if (*s == '+' && s[1] == ' ') {
+ new_rflags |= FILTRULE_INCLUDE;
+ s += 2;
+ } else if (*s == '!')
+ new_rflags |= FILTRULE_CLEAR_LIST; /* Tentative! */
+ } else {
+ char ch = 0, *mods = "";