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