Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made get_tmpname() non-static.
[rsync/rsync.git]
/
options.c
diff --git
a/options.c
b/options.c
index
5fd2993
..
fc8d605
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-106,7
+106,7
@@
size_t bwlimit_writemax = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
int ignore_existing = 0;
int ignore_non_existing = 0;
int need_messages_from_generator = 0;
-int max_delete =
0
;
+int max_delete =
-1
;
OFF_T max_size = 0;
OFF_T min_size = 0;
int ignore_errors = 0;
OFF_T max_size = 0;
OFF_T min_size = 0;
int ignore_errors = 0;
@@
-756,7
+756,7
@@
static OFF_T parse_size_arg(char **size_arg, char def_suf)
OFF_T num = size;
*s = '\0';
while (num) {
OFF_T num = size;
*s = '\0';
while (num) {
- *--s = (num % 10) + '0';
+ *--s = (
char)(
num % 10) + '0';
num /= 10;
}
if (!(*size_arg = strdup(s)))
num /= 10;
}
if (!(*size_arg = strdup(s)))
@@
-1246,12
+1246,8
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
if (!*backup_dir)
goto options_rejected;
clean_fname(backup_dir, 1);
if (!*backup_dir)
goto options_rejected;
clean_fname(backup_dir, 1);
- if (check_filter(elp, backup_dir, 1) < 0) {
- options_rejected:
- snprintf(err_buf, sizeof err_buf,
- "Your options have been rejected by the server.\n");
- return 0;
- }
+ if (check_filter(elp, backup_dir, 1) < 0)
+ goto options_rejected;
}
}
}
}
@@
-1457,6
+1453,11
@@
int parse_arguments(int *argc, const char ***argv, int frommain)
am_starting_up = 0;
return 1;
am_starting_up = 0;
return 1;
+
+ options_rejected:
+ snprintf(err_buf, sizeof err_buf,
+ "Your options have been rejected by the server.\n");
+ return 0;
}
}
@@
-1614,7
+1615,7
@@
void server_options(char **args,int *argc)
args[ac++] = arg;
}
args[ac++] = arg;
}
- if (max_delete && am_sender) {
+ if (max_delete
>= 0
&& am_sender) {
if (asprintf(&arg, "--max-delete=%d", max_delete) < 0)
goto oom;
args[ac++] = arg;
if (asprintf(&arg, "--max-delete=%d", max_delete) < 0)
goto oom;
args[ac++] = arg;