subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From phi...@apache.org
Subject svn commit: r1646797 - in /subversion/trunk/subversion: libsvn_subr/config.c tests/libsvn_subr/config-test.c
Date Fri, 19 Dec 2014 17:05:31 GMT
Author: philip
Date: Fri Dec 19 17:05:31 2014
New Revision: 1646797

URL: http://svn.apache.org/r1646797
Log:
Fix a long-standing pool handling bug when expanding config values.

* subversion/libsvn_subr/config.c
  (make_string_from_option): Copy expanded value whenever the pool
   is not the expanded values pool.

* subversion/tests/libsvn_subr/config-test.c
  (test_expand): Tweak comment.
  (test_funcs): Mark test_expand PASS.

Modified:
    subversion/trunk/subversion/libsvn_subr/config.c
    subversion/trunk/subversion/tests/libsvn_subr/config-test.c

Modified: subversion/trunk/subversion/libsvn_subr/config.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/config.c?rev=1646797&r1=1646796&r2=1646797&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/config.c (original)
+++ subversion/trunk/subversion/libsvn_subr/config.c Fri Dec 19 17:05:31 2014
@@ -514,14 +514,15 @@ make_string_from_option(const char **val
           expand_option_value(cfg, section, opt->value, &opt->x_value, tmp_pool);
           opt->expanded = TRUE;
 
-          if (!x_pool)
+          if (x_pool != cfg->x_pool)
             {
               /* Grab the fully expanded value from tmp_pool before its
                  disappearing act. */
               if (opt->x_value)
                 opt->x_value = apr_pstrmemdup(cfg->x_pool, opt->x_value,
                                               strlen(opt->x_value));
-              svn_pool_destroy(tmp_pool);
+              if (!x_pool)
+                svn_pool_destroy(tmp_pool);
             }
         }
       else

Modified: subversion/trunk/subversion/tests/libsvn_subr/config-test.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/config-test.c?rev=1646797&r1=1646796&r2=1646797&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/config-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/config-test.c Fri Dec 19 17:05:31 2014
@@ -363,8 +363,8 @@ test_expand(const svn_test_opts_t *opts,
   /* Get expanded "c". */
   svn_config_get(cfg, &val, "section1", "c", NULL);
 
-  /* This fails reliably with pool debugging enabled because the expanded
-     value of "c" was created in a temporary pool when expanding "g". */
+  /* With pool debugging enabled this ensures that the expanded value 
+     of "c" was not created in a temporary pool when expanding "g". */
   SVN_TEST_STRING_ASSERT(val, "bar");
 
   return SVN_NO_ERROR;
@@ -400,9 +400,8 @@ static struct svn_test_descriptor_t test
                    "test parsing config file with BOM"),
     SVN_TEST_OPTS_PASS(test_read_only_mode,
                        "test r/o mode"),
-    SVN_TEST_OPTS_WIMP(test_expand,
-                       "test variable expansion",
-                       "expansion fails with pool debugging"),
+    SVN_TEST_OPTS_PASS(test_expand,
+                       "test variable expansion"),
     SVN_TEST_NULL
   };
 



Mime
View raw message