[WIP PATCH 4/7] Replace deprecated svn_path_join

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Strip the deprecated svn_path_join API, using svn_path_compose
instead. Re-add -Werror to the Makefile.

Signed-off-by: Ramkumar Ramachandra <artagnon@xxxxxxxxx>
---
 Makefile      |    2 +-
 dump_editor.c |   21 ++++++++++++++-------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 269c406..cf7fef7 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
 svnclient_ra: *.c *.h
-	$(CC) -Wall -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c dump_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0
+	$(CC) -Wall -Werror -ggdb3 -O0 -o $@ svnclient_ra.c debug_editor.c dump_editor.c -lsvn_client-1 -I. -I/usr/local/include/subversion-1 -I/usr/include/apr-1.0
 clean:
 	$(RM) svnclient_ra
diff --git a/dump_editor.c b/dump_editor.c
index ba0630f..00c838a 100644
--- a/dump_editor.c
+++ b/dump_editor.c
@@ -80,14 +80,17 @@ struct dir_baton *make_dir_baton(const char *path,
 	struct dir_baton *pb = parent_dir_baton;
 	struct dir_baton *new_db = apr_pcalloc(pool, sizeof(*new_db));
 	const char *full_path;
-
+	apr_array_header_t *compose_path = apr_array_make(pool, 2, sizeof(const char *));
 
 	/* A path relative to nothing?  I don't think so. */
 	SVN_ERR_ASSERT_NO_RETURN(!path || pb);
 
 	/* Construct the full path of this node. */
-	if (pb)
-		full_path = svn_path_join("/", path, pool);
+	if (pb) {
+		APR_ARRAY_PUSH(compose_path, const char *) = "/";
+		APR_ARRAY_PUSH(compose_path, const char *) = path;
+		full_path = svn_path_compose(compose_path, pool);
+	}
 	else
 		full_path = apr_pstrdup(pool, "/");
 
@@ -332,12 +335,14 @@ svn_error_t *open_directory(const char *path,
 	struct dir_baton *new_db;
 	const char *cmp_path = NULL;
 	svn_revnum_t cmp_rev = SVN_INVALID_REVNUM;
+	apr_array_header_t *compose_path = apr_array_make(pool, 2, sizeof(const char *));
 
 	/* If the parent directory has explicit comparison path and rev,
 	   record the same for this one. */
 	if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev)) {
-		cmp_path = svn_path_join(pb->cmp_path,
-		                         svn_dirent_basename(path, pool), pool);
+		APR_ARRAY_PUSH(compose_path, const char *) = pb->cmp_path;
+		APR_ARRAY_PUSH(compose_path, const char *) = svn_dirent_basename(path, pool);
+		cmp_path = svn_path_compose(compose_path, pool);
 		cmp_rev = pb->cmp_rev;
 	}
 
@@ -424,11 +429,13 @@ svn_error_t *open_file(const char *path,
 	const char *cmp_path = NULL;
 	svn_revnum_t cmp_rev = SVN_INVALID_REVNUM;
 
+	apr_array_header_t *compose_path = apr_array_make(pool, 2, sizeof(const char *));
 	/* If the parent directory has explicit comparison path and rev,
 	   record the same for this one. */
 	if (pb && ARE_VALID_COPY_ARGS(pb->cmp_path, pb->cmp_rev)) {
-		cmp_path = svn_path_join(pb->cmp_path,
-		                         svn_dirent_basename(path, pool), pool);
+		APR_ARRAY_PUSH(compose_path, const char *) = pb->cmp_path;
+		APR_ARRAY_PUSH(compose_path, const char *) = svn_dirent_basename(path, pool);
+		cmp_path = svn_path_compose(compose_path, pool);
 		cmp_rev = pb->cmp_rev;
 	}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]