emacs-31 ade36467bf5: Fix 'url-parse-query-string'

Eli Zaretskii <[email protected]> Sun, 19 Jul 2026 02:34:15 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit ade36467bf5130935e6a83ba916227340a3068c3
Author: Eli Zaretskii <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    Fix 'url-parse-query-string'
    
    * lisp/url/url-util.el (url-parse-query-string): Fix use of
    'match-beginning' and 'match-end'.  (Bug#81430)
---
 lisp/url/url-util.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index d091092783c..fb70d553768 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -230,10 +230,12 @@ Will not do anything if `url-show-status' is nil."
         (setq cur (concat cur "=")))
 
       (when (string-match "=" cur)
-        (setq key (url-unhex-string (substring cur 0 (match-beginning 0))
-                                    allow-newlines))
-        (setq val (url-unhex-string (substring cur (match-end 0) nil)
-                                    allow-newlines))
+        (let ((beg (match-beginning 0))
+              (end (match-end 0)))
+          (setq key (url-unhex-string (substring cur 0 beg)
+                                      allow-newlines))
+          (setq val (url-unhex-string (substring cur end nil)
+                                      allow-newlines)))
         (if downcase
             (setq key (downcase key)))
         (setq cur (assoc key retval))