summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-03-31 00:21:15 +0000
committerWayne Davison <wayned@samba.org>2005-03-31 00:21:15 +0000
commit624d6be2a529114604da511dd1f3eadf509b4b9b (patch)
treef5346446c372572c9984cf88b33a28f8c4e0ee8a
parent16f960feb501d9c2444c1b5d8ad5ba81e932b975 (diff)
downloadrsync-624d6be2a529114604da511dd1f3eadf509b4b9b.tar.gz
rsync-624d6be2a529114604da511dd1f3eadf509b4b9b.tar.bz2
rsync-624d6be2a529114604da511dd1f3eadf509b4b9b.zip
Use new log_format_has() function instead of strstr().
-rw-r--r--clientserver.c4
-rw-r--r--options.c11
2 files changed, 7 insertions, 8 deletions
diff --git a/clientserver.c b/clientserver.c
index 531944aa..47ed5e7a 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -283,10 +283,10 @@ static int rsync_module(int f_in, int f_out, int i)
read_only = 1;
if (lp_transfer_logging(i)) {
- if (strstr(lp_log_format(i), "%i") != NULL)
+ if (log_format_has(lp_log_format(i), 'i'))
daemon_log_format_has_i = 1;
if (daemon_log_format_has_i
- || strstr(lp_log_format(i), "%o") != NULL)
+ || log_format_has(lp_log_format(i), 'o'))
daemon_log_format_has_o_or_i = 1;
}
diff --git a/options.c b/options.c
index 14b6634e..e6bc32b2 100644
--- a/options.c
+++ b/options.c
@@ -150,7 +150,6 @@ char *dest_option = NULL;
int verbose = 0;
int quiet = 0;
-int itemize_changes = 0;
int log_before_transfer = 0;
int log_format_has_i = 0;
int log_format_has_o_or_i = 0;
@@ -163,6 +162,7 @@ char *batch_name = NULL;
static int daemon_opt; /* sets am_daemon after option error-reporting */
static int F_option_cnt = 0;
static int modify_window_set;
+static int itemize_changes = 0;
static int refused_delete, refused_archive_part;
static int refused_partial, refused_progress, refused_delete_before;
static char *max_size_arg;
@@ -1078,10 +1078,10 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
omit_dir_times = 1;
if (log_format) {
- if (strstr(log_format, "%i") != NULL)
+ if (log_format_has(log_format, 'i'))
log_format_has_i = 1;
- if (strstr(log_format, "%b") == NULL
- && strstr(log_format, "%c") == NULL)
+ if (!log_format_has(log_format, 'b')
+ && !log_format_has(log_format, 'c'))
log_before_transfer = !am_server;
} else if (itemize_changes) {
log_format = "%i %n%L";
@@ -1097,8 +1097,7 @@ int parse_arguments(int *argc, const char ***argv, int frommain)
log_format = "%n%L";
log_before_transfer = !am_server;
}
- if (log_format_has_i
- || (log_format && strstr(log_format, "%o") != NULL))
+ if (log_format_has_i || log_format_has(log_format, 'o'))
log_format_has_o_or_i = 1;
if (daemon_bwlimit && (!bwlimit || bwlimit > daemon_bwlimit))