summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-10-19 00:47:48 +0000
committerAndrew Tridgell <tridge@samba.org>2000-10-19 00:47:48 +0000
commitc32d024071bd1519de936be65eaf8687260926ac (patch)
treea23a023be1a8248166e4aef7b022d09734ec0d7b
parent205c27ac6717fc54709a326202c649e09e2c4f03 (diff)
downloadrsync-c32d024071bd1519de936be65eaf8687260926ac.tar.gz
don't clobber argv[0], so ps shows the right thing
-rw-r--r--main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/main.c b/main.c
index 648c2371..e54ae8b0 100644
--- a/main.c
+++ b/main.c
@@ -557,11 +557,12 @@ static int start_client(int argc, char *argv[])
extern int am_sender;
extern char *shell_cmd;
extern int rsync_port;
+ char *argv0 = strdup(argv[0]);
- if (strncasecmp(URL_PREFIX, argv[0], strlen(URL_PREFIX)) == 0) {
+ if (strncasecmp(URL_PREFIX, argv0, strlen(URL_PREFIX)) == 0) {
char *host, *path;
- host = argv[0] + strlen(URL_PREFIX);
+ host = argv0 + strlen(URL_PREFIX);
p = strchr(host,'/');
if (p) {
*p = 0;
@@ -577,12 +578,12 @@ static int start_client(int argc, char *argv[])
return start_socket_client(host, path, argc-1, argv+1);
}
- p = find_colon(argv[0]);
+ p = find_colon(argv0);
if (p) {
if (p[1] == ':') {
*p = 0;
- return start_socket_client(argv[0], p+2, argc-1, argv+1);
+ return start_socket_client(argv0, p+2, argc-1, argv+1);
}
if (argc < 1) {