Den ons 20 maj 2026 kl 20:30 skrev <[email protected]>:
>
> Author: ivan
> Date: Wed May 20 18:29:58 2026
> New Revision: 1934443
>
> Log:
> Rewrite code to make it less error prone. No functional changes intended.
>
> * subversion/libsvn_subr/sysinfo.c
> (svn_sysinfo__linked_libs): Use separate scope for each lib.
>
> Modified:
> subversion/trunk/subversion/libsvn_subr/sysinfo.c
>
> Modified: subversion/trunk/subversion/libsvn_subr/sysinfo.c
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_subr/sysinfo.c Wed May 20 17:04:24
> 2026 (r1934442)
> +++ subversion/trunk/subversion/libsvn_subr/sysinfo.c Wed May 20 18:29:58
> 2026 (r1934443)
> @@ -146,56 +146,72 @@ svn_sysinfo__character_encoding(apr_pool
> const apr_array_header_t *
> svn_sysinfo__linked_libs(apr_pool_t *pool)
> {
> - svn_version_ext_linked_lib_t *lib;
> - apr_array_header_t *array = apr_array_make(pool, 7, sizeof(*lib));
> - int lz4_version = svn_lz4__runtime_version();
> -
> - lib = &APR_ARRAY_PUSH(array, svn_version_ext_linked_lib_t);
> - lib->name = "APR";
> - lib->compiled_version = APR_VERSION_STRING;
> - lib->runtime_version = apr_pstrdup(pool, apr_version_string());
> + apr_array_header_t *array =
> + apr_array_make(pool, 7, sizeof(svn_version_ext_linked_lib_t));
> +
> + {
> + svn_version_ext_linked_lib_t *lib = apr_array_push(array);
> + lib->name = "APR";
> + lib->compiled_version = APR_VERSION_STRING;
> + lib->runtime_version = apr_pstrdup(pool, apr_version_string());
> + }
Would it make sense to factor this out to a separate function, instead
of duplicating this code here...
> + {
> + svn_version_ext_linked_lib_t *lib = apr_array_push(array);
> + lib->name = "APR-Util";
> + lib->compiled_version = APU_VERSION_STRING;
> + lib->runtime_version = apr_pstrdup(pool, apu_version_string());
> + }
And here...
> + {
> + svn_version_ext_linked_lib_t *lib = apr_array_push(array);
> + lib->name = "Expat";
> + lib->compiled_version = apr_pstrdup(pool, svn_xml__compiled_version());
> + lib->runtime_version = apr_pstrdup(pool, svn_xml__runtime_version());
> + }
And in X more places below?
(The #ifdef SVN_SQLITE_INLINE might be difficult to manage)
Cheers,
Daniel