diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-10-19 00:47:48 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-10-19 00:47:48 +0000 |
commit | c32d024071bd1519de936be65eaf8687260926ac (patch) | |
tree | a23a023be1a8248166e4aef7b022d09734ec0d7b | |
parent | 205c27ac6717fc54709a326202c649e09e2c4f03 (diff) | |
download | rsync-c32d024071bd1519de936be65eaf8687260926ac.tar.gz |
don't clobber argv[0], so ps shows the right thing
-rw-r--r-- | main.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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) { |