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
Fixed one synopsis line to make the DEST arg optional.
[rsync/rsync.git]
/
main.c
diff --git
a/main.c
b/main.c
index
42f4a6f
..
f589aa3
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-163,7
+163,9
@@
static void handle_stats(int f)
/* this is the client */
/* this is the client */
- if (!am_sender) {
+ if (f < 0 && !am_sender) /* e.g. when we got an empty file list. */
+ ;
+ else if (!am_sender) {
/* Read the first two in opposite order because the meaning of
* read/write swaps when switching from sender to receiver. */
total_written = read_longint(f);
/* Read the first two in opposite order because the meaning of
* read/write swaps when switching from sender to receiver. */
total_written = read_longint(f);
@@
-294,7
+296,7
@@
static pid_t do_cmd(char *cmd, char *machine, char *user, char *path,
for (tok = strtok(cmd, " "); tok; tok = strtok(NULL, " ")) {
/* Comparison leaves rooms for server_options(). */
for (tok = strtok(cmd, " "); tok; tok = strtok(NULL, " ")) {
/* Comparison leaves rooms for server_options(). */
- if (argc >= MAX_ARGS -
100
) {
+ if (argc >= MAX_ARGS -
MAX_SERVER_ARGS
) {
rprintf(FERROR, "internal: args[] overflowed in do_cmd()\n");
exit_cleanup(RERR_SYNTAX);
}
rprintf(FERROR, "internal: args[] overflowed in do_cmd()\n");
exit_cleanup(RERR_SYNTAX);
}
@@
-808,17
+810,16
@@
int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
if (write_batch && !am_server)
start_write_batch(f_in);
flist = recv_file_list(f_in);
if (write_batch && !am_server)
start_write_batch(f_in);
flist = recv_file_list(f_in);
- if (!flist || flist->count == 0) {
- rprintf(FINFO, "client: nothing to do: "
- "perhaps you need to specify some filenames or "
- "the --recursive option?\n");
- exit_cleanup(0);
- }
the_file_list = flist;
the_file_list = flist;
- local_name = get_local_name(flist,argv[0]);
+ if (flist && flist->count > 0) {
+ local_name = get_local_name(flist, argv[0]);
- status2 = do_recv(f_in,f_out,flist,local_name);
+ status2 = do_recv(f_in, f_out, flist, local_name);
+ } else {
+ handle_stats(-1);
+ output_summary();
+ }
if (pid != -1) {
if (verbose > 3)
if (pid != -1) {
if (verbose > 3)