summaryrefslogtreecommitdiff
path: root/exclude.c
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-01-27 08:31:24 -0800
committerWayne Davison <wayne@opencoder.net>2022-01-27 08:53:41 -0800
commit81f71f6f29656325863d5da78f4fece991d1574d (patch)
tree17dfff92e9034a073c9404ab75543908ec4d01fe /exclude.c
parent48e700555424d535da30f6118b3c753502f66a87 (diff)
downloadrsync-81f71f6f29656325863d5da78f4fece991d1574d.tar.gz
Add a CAUTION message to --debug=FILTER for trailing whitespace.
Diffstat (limited to 'exclude.c')
-rw-r--r--exclude.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/exclude.c b/exclude.c
index e0957443..4ee06a84 100644
--- a/exclude.c
+++ b/exclude.c
@@ -152,13 +152,17 @@ static void add_rule(filter_rule_list *listp, const char *pat, unsigned int pat_
{
const char *cp;
unsigned int pre_len, suf_len, slash_cnt = 0;
+ char *mention_rule_suffix;
- if (DEBUG_GTE(FILTER, 2)) {
- rprintf(FINFO, "[%s] add_rule(%s%.*s%s)%s\n",
+ if (DEBUG_GTE(FILTER, 1) && pat_len && (pat[pat_len-1] == ' ' || pat[pat_len-1] == '\t'))
+ mention_rule_suffix = " -- CAUTION: trailing whitespace!";
+ else
+ mention_rule_suffix = DEBUG_GTE(FILTER, 2) ? "" : NULL;
+ if (mention_rule_suffix) {
+ rprintf(FINFO, "[%s] add_rule(%s%.*s%s)%s%s\n",
who_am_i(), get_rule_prefix(rule, pat, 0, NULL),
- (int)pat_len, pat,
- (rule->rflags & FILTRULE_DIRECTORY) ? "/" : "",
- listp->debug_type);
+ (int)pat_len, pat, (rule->rflags & FILTRULE_DIRECTORY) ? "/" : "",
+ listp->debug_type, mention_rule_suffix);
}
/* These flags also indicate that we're reading a list that