rem: } else rsync_port = RSYNC_PORT;
add: }
context: static int start_client(int argc, char *argv[]){	char *p;	char *shell_machine = NULL;	char *shell_path = NULL;	char *shell_user = NULL;	int ret;	pid_t pid;	int f_in,f_out;	int rc;	/* Don't clobber argv[] so that ps(1) can still show the right	 * command line. */	if ((rc = copy_argv(argv)))		return rc;	/* rsync:// always uses rsync server over direct socket connection */	if (strncasecmp(URL_PREFIX, argv[0], strlen(URL_PREFIX)) == 0	    && !read_batch) {		char *host, *path;		host = argv[0] + strlen(URL_PREFIX);		p = strchr(host,'/');		if (p) {			*p = '\0';			path = p+1;		} else			path = "";		if (*host == '[' && (p = strchr(host, ']')) != NULL) {			host++;			*p++ = '\0';			if (*p != ':')				p = NULL;		} else			p = strchr(host, ':');		if (p) {			rsync_port = atoi(p+1);			*p = '\0';		} else			rsync_port = RSYNC_PORT;		return start_socket_client(host, path, argc-1, argv+1);	}	if (!read_batch) { /* for read_batch, NO source is specified */		p = find_colon(argv[0]);		if (p) { /* source is remote */			if (remote_filesfrom_file			 && remote_filesfrom_file != files_from + 1			 && strncmp(files_from, argv[0], p-argv[0]+1) != 0) {				rprintf(FERROR,					"--files-from hostname is not the same as the transfer hostname\n");				exit_cleanup(RERR_SYNTAX);			}			if (p[1] == ':') { /* double colon */				*p = 0;				if (!shell_cmd) {					return start_socket_client(argv[0], p+2,								   argc-1, argv+1);				}				p++;				daemon_over_rsh = 1;			}			if (argc < 1) { /* destination required */				usage(FERROR);				exit_cleanup(RERR_SYNTAX);			}			am_sender = 0;			*p = 0;			shell_machine = argv[0];			shell_path = p+1;			argv++;		} else { /* source is local */			am_sender = 1;			/* rsync:// destination uses rsync server over direct socket */			if (strncasecmp(URL_PREFIX, argv[argc-1], strlen(URL_PREFIX)) == 0) {				char *host, *path;				host = argv[argc-1] + strlen(URL_PREFIX);				p = strchr(host,'/');				if (p) {					*p = '\0';					path = p+1;				} else					path = "";				if (*host == '[' && (p = strchr(host, ']')) != NULL) {					host++;					*p++ = '\0';					if (*p != ':')						p = NULL;				} else					p = strchr(host, ':');				if (p) {					rsync_port = atoi(p+1);					*p = '\0';				} else					rsync_port = RSYNC_PORT;				return start_socket_client(host, path, argc-1, argv);			}			p = find_colon(argv[argc-1]); /* look in dest arg */			if (p && remote_filesfrom_file			 && remote_filesfrom_file != files_from + 1			 && strncmp(files_from, argv[argc-1], p-argv[argc-1]+1) != 0) {				rprintf(FERROR,					"--files-from hostname is not the same as the transfer hostname\n");				exit_cleanup(RERR_SYNTAX);			}			if (!p) { /* no colon found, so src & dest are local */				local_server = 1;				if (remote_filesfrom_file) {					rprintf(FERROR,						"--files-from cannot be remote when the transfer is local\n");					exit_cleanup(RERR_SYNTAX);				}			} else if (p[1] == ':') { /* double colon */				*p = 0;				if (!shell_cmd) {					return start_socket_client(argv[argc-1], p+2,								   argc-1, argv);				}				p++;				daemon_over_rsh = 1;			}			if (argc < 2) {				usage(FERROR);				exit_cleanup(RERR_SYNTAX);			}			if (local_server) {				shell_machine = NULL;				shell_path = argv[argc-1];			} else {				*p = 0;				shell_machine = argv[argc-1];				shell_path = p+1;			}		}		argc--;	} else {  /* read_batch */		local_server = 1;		shell_path = argv[argc-1];		if (find_colon(shell_path)) {			rprintf(FERROR, "remote destination is not allowed with --read-batch\n");			exit_cleanup(RERR_SYNTAX);		}	}	if (shell_machine) {		p = strrchr(shell_machine,'@');		if (p) {			*p = 0;			shell_user = shell_machine;			shell_machine = p+1;		}	}	if (verbose > 3) {		rprintf(FINFO,"cmd=%s machine=%s user=%s path=%s\n",			shell_cmd?shell_cmd:"",			shell_machine?shell_machine:"",			shell_user?shell_user:"",			shell_path?shell_path:"");	}	/* for remote source, only single dest arg can remain ... */	if (!am_sender && argc > 1) {		usage(FERROR);		exit_cleanup(RERR_SYNTAX);	}	/* ... or no dest at all */	if (!am_sender && argc == 0) {		list_only = 1;	}	pid = do_cmd(shell_cmd,shell_machine,shell_user,shell_path,		     &f_in,&f_out);	/* if we're running an rsync server on the remote host over a	 * remote shell command, we need to do the RSYNCD protocol first */	if (daemon_over_rsh) {		int tmpret;		tmpret = start_inband_exchange(shell_user, shell_path,					       f_in, f_out, argc);		if (tmpret < 0)			return tmpret;	}	ret = client_run(f_in, f_out, pid, argc, argv);	fflush(stdout);	fflush(stderr);	return ret;}