On Mon, Sep 14, 2026 at 02:32:22PM +0200, Sergii Rudchenko wrote:
> On 9/14/26 10:44 AM, Stuart Henderson wrote:
> > please use "make update-patches" to generate the patch files; from what
> you
> > have now, "make clean; make patch; rm
> > patches/patch-libs_url_base_edit_params; make update-patches".
> 
> Thank you, the updated ports diff is below.
> 
> I am not sure if it is worth including the patches for units tests as they
> have
> no effect on the resulting package. Leaving it to the committer to decide
> whether to delete patch-libs_url_test_unit_params_encoded_ref_cpp and
> patch-libs_url_test_unit_params_ref_cpp.

There are some whitespace issues in both your diffs and hence they don't
apply. Here's one that does apply. I think we should only commit the
actual code change.

Brad, are you ok with that?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boost/Makefile,v
diff -u -p -r1.163 Makefile
--- Makefile    18 May 2026 05:48:17 -0000      1.163
+++ Makefile    14 Sep 2026 12:39:42 -0000
@@ -13,6 +13,8 @@ CATEGORIES=   devel
 SITES=         https://archives.boost.io/release/${VERSION}/source/
 EXTRACT_SUFX=  .tar.bz2
 
+REVISION-main= 0
+
 SO_VERSION=    27.0
 BOOST_LIBS=    boost_atomic-mt \
                boost_charconv-mt boost_charconv \
Index: patches/patch-boost_url_impl_url_base_hpp
===================================================================
RCS file: patches/patch-boost_url_impl_url_base_hpp
diff -N patches/patch-boost_url_impl_url_base_hpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_url_impl_url_base_hpp   14 Sep 2026 12:40:51 -0000
@@ -0,0 +1,49 @@
+Fix for URL corruption bug on url.params().append() in Boost 1.91.0
+
+https://github.com/boostorg/url/issues/990
+https://github.com/boostorg/url/pull/990
+
+Index: boost/url/impl/url_base.hpp
+--- boost/url/impl/url_base.hpp.orig
++++ boost/url/impl/url_base.hpp
+@@ -3159,7 +3159,12 @@ edit_params(
+     BOOST_ASSERT(pos1 <= impl_.offset(id_frag));
+ 
+     // calc decoded size of old range,
+-    // minus one if '?' or '&' prefixed
++    // minus one for the leading '?' which is
++    // not counted in decoded_[id_query].
++    // dn0 may be -1 here when the old range is
++    // empty and the query was non-empty; the
++    // matching subtraction on dn below cancels
++    // that out when the delta is taken.
+     auto dn0 =
+         static_cast<std::ptrdiff_t>(
+             detail::decode_bytes_unsafe(
+@@ -3168,8 +3173,6 @@ edit_params(
+                     pos1 - pos0)));
+     if(impl_.len(id_query) > 0)
+         dn0 -= 1;
+-    if(dn0 < 0)
+-        dn0 = 0;
+ 
+ //------------------------------------------------
+ //
+@@ -3267,16 +3270,13 @@ edit_params(
+         }
+     }
+ 
+-    // calc decoded size of new range,
+-    // minus one if '?' or '&' prefixed
++    // calc decoded size of new range; see dn0.
+     auto dn =
+         static_cast<std::ptrdiff_t>(
+             detail::decode_bytes_unsafe(
+                 core::string_view(dest0, dest - dest0)));
+     if(impl_.len(id_query) > 0)
+         dn -= 1;
+-    if(dn < 0)
+-        dn = 0;
+ 
+     if(dn >= dn0)
+         impl_.decoded_[id_query] +=

Reply via email to