/* Get the next include/exclude arg from the string. The token will not
* be '\0' terminated, so use the returned length to limit the string.
* Also, be sure to add this length to the returned pointer before passing
- * it back to ask for the next token. This routine parses the +/- prefixes
- * and the "!" token unless xflags contains XFLG_WORDS_ONLY. The *flag_ptr
+ * it back to ask for the next token. This routine parses the "!" (list-
+ * clearing) token and (if xflags does NOT contain XFLG_WORDS_ONLY) the
+ * +/- prefixes for overriding the include/exclude mode. The *flag_ptr
* value will also be set to the MATCHFLG_* bits for the current token.
*/
static const char *get_exclude_tok(const char *p, unsigned int *len_ptr,
} else
len = strlen(s);
- if (*p == '!' && len == 1 && !(xflags & XFLG_WORDS_ONLY))
+ if (*p == '!' && len == 1)
mflags |= MATCHFLG_CLEAR_LIST;
*len_ptr = len;
{
struct exclude_struct *ent;
- /* This is a complete hack - blame Rusty.
- *
- * FIXME: This pattern shows up in the output of
- * report_exclude_result(), which is not ideal. */
- if (list_only && !recurse)
+ /* This is a complete hack - blame Rusty. FIXME!
+ * Remove this hack when older rsyncs (below 2.6.4) are gone. */
+ if (list_only == 1 && !recurse)
add_exclude(&exclude_list, "/*/*", 0);
for (ent = exclude_list.head; ent; ent = ent->next) {
if (ent->match_flags & MATCHFLG_INCLUDE) {
write_int(f, l + 2);
write_buf(f, "+ ", 2);
- } else if ((*p == '-' || *p == '+') && p[1] == ' ') {
+ } else if (*p == '-' || *p == '+') {
write_int(f, l + 2);
write_buf(f, "- ", 2);
} else