if (do_mkdir(name,0777 & ~orig_umask) != 0) {
rsyserr(FERROR, errno, "mkdir %s failed", full_fname(name));
exit_cleanup(RERR_FILEIO);
- } else {
- if (verbose > 0)
- rprintf(FINFO,"created directory %s\n",name);
+ }
+ if (verbose > 0)
+ rprintf(FINFO, "created directory %s\n", name);
+
+ if (dry_run) {
+ dry_run++;
+ return NULL;
}
if (!push_dir(name)) {
host = argv[0] + strlen(URL_PREFIX);
p = strchr(host,'/');
if (p) {
- *p = 0;
+ *p = '\0';
path = p+1;
- } else {
+ } else
path = "";
- }
- p = strchr(host,':');
+ 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;
+ *p = '\0';
}
return start_socket_client(host, path, argc-1, argv+1);
}
&& remote_filesfrom_file != files_from + 1
&& strncmp(files_from, argv[0], p-argv[0]+1) != 0) {
rprintf(FERROR,
- "--files-from hostname is not transfer hostname\n");
+ "--files-from hostname is not the same as the transfer hostname\n");
exit_cleanup(RERR_SYNTAX);
}
if (p[1] == ':') { /* double colon */
host = argv[argc-1] + strlen(URL_PREFIX);
p = strchr(host,'/');
if (p) {
- *p = 0;
+ *p = '\0';
path = p+1;
- } else {
+ } else
path = "";
- }
- p = strchr(host,':');
+ 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;
+ *p = '\0';
}
return start_socket_client(host, path, argc-1, argv);
}
&& 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 transfer hostname\n");
+ "--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 is remote but transfer is local\n");
+ "--files-from cannot be remote when the transfer is local\n");
exit_cleanup(RERR_SYNTAX);
}
} else if (p[1] == ':') { /* double colon */