You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2013/05/12 21:23:17 UTC
svn commit: r1481625 - in /subversion/trunk/subversion: include/svn_path.h
libsvn_subr/path.c
Author: stsp
Date: Sun May 12 19:23:16 2013
New Revision: 1481625
URL: http://svn.apache.org/r1481625
Log:
Expose a static helper function in libsvn_subr/path.c as a public API.
Copies of this function exist in libsvn_fs_fs and libsvn_repos, and
subsequent commits will remove this code duplication. I'm committing this
change in isolation to simplify potential future merges to 1.8.x/1.7.x.
* subversion/include/svn_path.h
(svn_path_illegal_path_escape): Declare.
* subversion/libsvn_subr/path.c
(illegal_path_escape): Rename to ...
(svn_path_illegal_path_escape): ... this. Docstring has been moved to
the public header. Otherwise unchanged.
(svn_path_check_valid): Update caller.
Modified:
subversion/trunk/subversion/include/svn_path.h
subversion/trunk/subversion/libsvn_subr/path.c
Modified: subversion/trunk/subversion/include/svn_path.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_path.h?rev=1481625&r1=1481624&r2=1481625&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_path.h (original)
+++ subversion/trunk/subversion/include/svn_path.h Sun May 12 19:23:16 2013
@@ -716,6 +716,14 @@ svn_path_resolve_repos_relative_url(cons
const char *repos_root_url,
apr_pool_t *pool);
+/* Return a copy of @a path, allocated from @a pool, for which control
+ * characters have been escaped using the form \NNN (where NNN is the
+ * octal representation of the byte's ordinal value).
+ *
+ * @since New in 1.9. */
+const char *
+svn_path_illegal_path_escape(const char *path, apr_pool_t *pool);
+
/** @} */
#ifdef __cplusplus
Modified: subversion/trunk/subversion/libsvn_subr/path.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/path.c?rev=1481625&r1=1481624&r2=1481625&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/path.c (original)
+++ subversion/trunk/subversion/libsvn_subr/path.c Sun May 12 19:23:16 2013
@@ -1167,8 +1167,8 @@ svn_path_cstring_to_utf8(const char **pa
/* Return a copy of PATH, allocated from POOL, for which control
characters have been escaped using the form \NNN (where NNN is the
octal representation of the byte's ordinal value). */
-static const char *
-illegal_path_escape(const char *path, apr_pool_t *pool)
+const char *
+svn_path_illegal_path_escape(const char *path, apr_pool_t *pool)
{
svn_stringbuf_t *retstr;
apr_size_t i, copied = 0;
@@ -1232,7 +1232,8 @@ svn_path_check_valid(const char *path, a
(SVN_ERR_FS_PATH_SYNTAX, NULL,
_("Invalid control character '0x%02x' in path '%s'"),
(unsigned char)*c,
- illegal_path_escape(svn_dirent_local_style(path, pool), pool));
+ svn_path_illegal_path_escape(svn_dirent_local_style(path, pool),
+ pool));
}
}