On Thu, 9 Dec 2004, VK Sameer wrote:
Index: subversion/include/svn_path.h
===================================================================
--- subversion/include/svn_path.h (revision 12257)
+++ subversion/include/svn_path.h (working copy)
@@ -356,6 +356,39 @@
const char *path2,
apr_pool_t *pool);
+/**
+ * @since New in 1.2.
+ *
+ * Check whether @a path is a valid Subversion path
+ * @a pool is used for temporary allocation
+ * @a check_utf8 turns on additional checks
+ *
Use periods between the sentences above.
+ * A valid Subversion pathname is a UTF-8 string without control
+ * characters, except for SPACE (0x20). "Valid" means Subversion
When did space become a control character? I know you got this docstring
in a review, but it's still not correct in this regard.
+ * can store the pathname in a repository. There may be other
+ * OS-specific limitations on what paths can be represented in
+ * a working copy.
+ */
+svn_boolean_t svn_path_is_valid (const char *path,
+ apr_pool_t *pool,
+ svn_boolean_t check_utf8);
+
+/**
+ * @since New in 1.2.
+ *
+ * Check whether @a path is a valid Subversion path and generate
+ * error if invalid. See docstring of svn_path_is_valid() for
+ * definition of valid pathname
+ * @a pool is used for temporary allocation
+ * @a check_utf8 turns on additional checks
+ *
+ * returns SVN_NO_ERROR if valid
+ * returns SVN_ERR_FS_PATH_SYNTAX if invalid
+ */
+svn_error_t *svn_path_error_if_invalid (const char *path,
+ apr_pool_t *pool,
+ svn_boolean_t check_utf8);
+
Rename this to svn_path_check_valid and drop the above one. INvalid paths
are really not expected very often, so there is no point in cluttering the
API with an extra function that just returns a boolean. Also, drop the
UTF8 check in this function. Nearly all our APIs that take strings expect
valid UTF8. Idally the servers should check *all* strings that are
expected to be in UTF8 as a means of input validation. That's not unique
to paths. Exporting the UTF8 validation, as you do later in the patch, is
a good idea for this purpose.
I agree with philip regarding the rest of the patch.
Thansk for taking this,
//Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Dec 10 19:24:58 2004