svn commit: r1932712 - subversion/trunk/subversion/svnbrowse

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <177506733608.1786632.5532588961179254877@svn03-he-fi>
Author: rinrab
Date: Wed Apr  1 18:15:35 2026
New Revision: 1932712

Log:
svnbrowse: Recompute the abspath every time it is needed instead of storing one
in the browser context; It more convenient and we don't really care about every
bit of performance that it would make up.

* subversion/svnbrowse/svnbrowse.c
  (svn_browse__ctx_t): Remove abspath field.
  (enter_path): Store combined path in a local variable instead of writing it
   into the ctx.
  (ui_draw): Call svn_path_url_add_component2() to join URL for displaying in
   the header.

Modified:
   subversion/trunk/subversion/svnbrowse/svnbrowse.c

Modified: subversion/trunk/subversion/svnbrowse/svnbrowse.c
==============================================================================
--- subversion/trunk/subversion/svnbrowse/svnbrowse.c	Wed Apr  1 17:58:16 2026	(r1932711)
+++ subversion/trunk/subversion/svnbrowse/svnbrowse.c	Wed Apr  1 18:15:35 2026	(r1932712)
@@ -45,7 +45,6 @@ typedef struct svn_browse__item_t {
 typedef struct svn_browse__ctx_t {
   const char *root;
   const char *relpath;
-  const char *abspath;
   svn_opt_revision_t revision;
 
   svn_client_ctx_t *client;
@@ -93,13 +92,13 @@ list_cb(void *baton,
 static svn_error_t *
 enter_path(svn_browse__ctx_t *ctx, const char *relpath, apr_pool_t *pool)
 {
+  const char *abspath = svn_path_url_add_component2(ctx->root, relpath, pool);
   ctx->relpath = apr_pstrdup(pool, relpath);
-  ctx->abspath = svn_path_url_add_component2(ctx->root, relpath, pool);
 
   ctx->list = apr_array_make(pool, 0, sizeof(svn_browse__item_t *));
   ctx->selection = 0;
 
-  SVN_ERR(svn_client_list4(ctx->abspath, &ctx->revision, &ctx->revision, NULL,
+  SVN_ERR(svn_client_list4(abspath, &ctx->revision, &ctx->revision, NULL,
                            svn_depth_immediates, SVN_DIRENT_ALL, TRUE, TRUE,
                            list_cb, ctx, ctx->client, pool));
 
@@ -110,8 +109,10 @@ static void
 ui_draw(svn_browse__ctx_t *ctx, apr_pool_t *pool)
 {
   int i;
+  const char *abspath = svn_path_url_add_component2(ctx->root, ctx->relpath,
+                                                    pool);
 
-  mvprintw(0, 4, "Browsing: %s", ctx->abspath);
+  mvprintw(0, 4, "Browsing: %s", abspath);
 
   for (i = 0; i < ctx->list->nelts; i++)
     {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.