diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
commit | cf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch) | |
tree | da27775a2161723ef342e91af41a8b51fedef405 /subversion/libsvn_client/cmdline.c | |
parent | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff) | |
download | subversion-tarball-master.tar.gz |
subversion-1.9.7HEADsubversion-1.9.7master
Diffstat (limited to 'subversion/libsvn_client/cmdline.c')
-rw-r--r-- | subversion/libsvn_client/cmdline.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/subversion/libsvn_client/cmdline.c b/subversion/libsvn_client/cmdline.c index a17f8c4..a850b4e 100644 --- a/subversion/libsvn_client/cmdline.c +++ b/subversion/libsvn_client/cmdline.c @@ -87,7 +87,7 @@ check_root_url_of_target(const char **root_url, if ((err->apr_err == SVN_ERR_ENTRY_NOT_FOUND) || (err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND) || (err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY) - || (err->apr_err == SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED) + || (err->apr_err == SVN_ERR_RA_CANNOT_CREATE_SESSION) || (err->apr_err == SVN_ERR_CLIENT_BAD_REVISION)) { svn_error_clear(err); @@ -200,6 +200,15 @@ svn_client_args_to_target_array2(apr_array_header_t **targets_p, SVN_ERR(svn_opt__split_arg_at_peg_revision(&true_target, &peg_rev, utf8_target, pool)); + /* Reject the form "@abc", a peg specifier with no path. */ + if (true_target[0] == '\0' && peg_rev[0] != '\0') + { + return svn_error_createf(SVN_ERR_BAD_FILENAME, NULL, + _("'%s' is just a peg revision. " + "Maybe try '%s@' instead?"), + utf8_target, utf8_target); + } + /* URLs and wc-paths get treated differently. */ if (svn_path_is_url(true_target)) { @@ -278,7 +287,7 @@ svn_client_args_to_target_array2(apr_array_header_t **targets_p, } } - target = apr_pstrcat(pool, true_target, peg_rev, (char *)NULL); + target = apr_pstrcat(pool, true_target, peg_rev, SVN_VA_NULL); if (rel_url_found) { @@ -338,7 +347,7 @@ svn_client_args_to_target_array2(apr_array_header_t **targets_p, SVN_ERR(svn_opt__arg_canonicalize_url(&true_target, abs_target, pool)); - target = apr_pstrcat(pool, true_target, peg_rev, (char *)NULL); + target = apr_pstrcat(pool, true_target, peg_rev, SVN_VA_NULL); } APR_ARRAY_PUSH(*targets_p, const char *) = target; |