- /* 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';
- }
- 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) {
+ shell_path = check_for_hostspec(argv[argc-1], &shell_machine, &rsync_port);
+ if (shell_path && filesfrom_host && *filesfrom_host
+ && strcmp(filesfrom_host, shell_machine) != 0) {