[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Sat May 7 14:00:36 MDT 2011


The branch, master has been updated
       via  8bcd6a4 Abort if the cd fails.
       via  58663df Turn empty remote args into dot dirs.
       via  da7acc5 Make --files-from allow a missing trailing arg w/--server.
       via  54d1360 Mention the number of child args.
      from  3ed84db Don't die if man-copy fails.

;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8bcd6a4afff3cb8197d5589ec4fdf9fe153f53de
Author: Wayne Davison <wayned at samba.org>
Date:   Sat May 7 12:58:11 2011 -0700

    Abort if the cd fails.

commit 58663df4323991bde024ffe4436b67e53f56e52b
Author: Wayne Davison <wayned at samba.org>
Date:   Sat May 7 12:31:33 2011 -0700

    Turn empty remote args into dot dirs.

commit da7acc5e425e3221a24925b864bec1abbe8d4901
Author: Wayne Davison <wayned at samba.org>
Date:   Sat May 7 12:16:12 2011 -0700

    Make --files-from allow a missing trailing arg w/--server.

commit 54d13604fa7521d7879c5552d56c197d6f542467
Author: Wayne Davison <wayned at samba.org>
Date:   Sat May 7 12:11:33 2011 -0700

    Mention the number of child args.

-----------------------------------------------------------------------

Summary of changes:
 main.c      |    5 +++++
 options.c   |    2 +-
 support/lsh |    6 ++++--
 util.c      |    4 +++-
 4 files changed, 13 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/main.c b/main.c
index de5bc48..16b283c 100644
--- a/main.c
+++ b/main.c
@@ -1313,6 +1313,9 @@ static int start_client(int argc, char *argv[])
 		remote_argc = argc = 1;
 	}
 
+	if (!rsync_port && remote_argc && !**remote_argv) /* Turn an empty arg into a dot dir. */
+		*remote_argv = ".";
+
 	if (am_sender) {
 		char *dummy_host;
 		int dummy_port = rsync_port;
@@ -1348,6 +1351,8 @@ static int start_client(int argc, char *argv[])
 					rprintf(FERROR, "All source args must use the same port number.\n");
 				exit_cleanup(RERR_SYNTAX);
 			}
+			if (!rsync_port && !*arg) /* Turn an empty arg into a dot dir. */
+				arg = ".";
 			remote_argv[i] = arg;
 		}
 	}
diff --git a/options.c b/options.c
index 1041c97..a8c5b49 100644
--- a/options.c
+++ b/options.c
@@ -2228,7 +2228,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
 	if (files_from) {
 		char *h, *p;
 		int q;
-		if (argc > 2 || (!am_daemon && argc == 1)) {
+		if (argc > 2 || (!am_daemon && !am_server && argc == 1)) {
 			usage(FERROR);
 			exit_cleanup(RERR_SYNTAX);
 		}
diff --git a/support/lsh b/support/lsh
index 8ccc5a2..b63444e 100755
--- a/support/lsh
+++ b/support/lsh
@@ -24,10 +24,12 @@ if [ "$user" ]; then
     prefix=''
     if [ $do_cd = y ]; then
 	home=`perl -e "print((getpwnam('$user'))[7])"`
-	prefix="cd '$home' ;"
+	prefix="cd '$home' &&"
     fi
     sudo -H -u "$user" sh -c "$prefix $*"
 else
-    [ $do_cd = y ] && cd
+    if [ $do_cd = y ]; then
+	cd || exit 1
+    fi
     eval "${@}"
 fi
diff --git a/util.c b/util.c
index 5200a9a..abf0cd4 100644
--- a/util.c
+++ b/util.c
@@ -94,6 +94,7 @@ int fd_pair(int fd[2])
 
 void print_child_argv(const char *prefix, char **cmd)
 {
+	int cnt = 0;
 	rprintf(FCLIENT, "%s ", prefix);
 	for (; *cmd; cmd++) {
 		/* Look for characters that ought to be quoted.  This
@@ -107,8 +108,9 @@ void print_child_argv(const char *prefix, char **cmd)
 		} else {
 			rprintf(FCLIENT, "%s ", *cmd);
 		}
+		cnt++;
 	}
-	rprintf(FCLIENT, "\n");
+	rprintf(FCLIENT, " (%d args)\n", cnt);
 }
 
 NORETURN void out_of_memory(const char *str)


-- 
The rsync repository.


More information about the rsync-cvs mailing list