diff -r 17ccf828a2f2 -r 1ce7211a1021 dav/main.c --- a/dav/main.c Tue May 29 20:38:22 2018 +0200 +++ b/dav/main.c Wed May 30 10:07:48 2018 +0200 @@ -218,7 +218,7 @@ " -R " "Recursively do the operation for all children\n"); fprintf(stderr, " -K Keep already present files\n"); - fprintf(stderr, " -o Write output to file\n"); + fprintf(stderr, " -o Write output to file (use '-' for stdout)\n"); fprintf( stderr, " -u " @@ -1310,10 +1310,6 @@ char *path1 = NULL; Repository *repo1 = url2repo(url1, &path1); - char *url2 = a->argv[1]; - char *path2 = NULL; - Repository *repo2 = url2repo(url2, &path2); - DavSession *sn = connect_to_repo(repo1, a); if(set_session_config(sn, a)) { return -1; @@ -1322,6 +1318,10 @@ DavBool override = cmd_getoption(a, "override") ? true : false; + char *url2 = a->argv[1]; + char *path2 = NULL; + Repository *repo2 = url2repo(url2, &path2); + if(repo1 == repo2) { DavResource *res = dav_resource_new(sn, path1); int err = cp ? dav_copy_o(res, path2, override)