[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/compat 317b88abdc 08/13: Fix args-out-of-range signal u
From: |
ELPA Syncer |
Subject: |
[elpa] externals/compat 317b88abdc 08/13: Fix args-out-of-range signal upper-bound edge case |
Date: |
Sun, 13 Mar 2022 19:57:33 -0400 (EDT) |
branch: externals/compat
commit 317b88abdcedc6d7a38dff2a6a2bc538bb920f93
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Fix args-out-of-range signal upper-bound edge case
---
compat-28.el | 3 ++-
compat-tests.el | 8 ++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/compat-28.el b/compat-28.el
index 60e3fa4999..6f55fd4564 100644
--- a/compat-28.el
+++ b/compat-28.el
@@ -49,7 +49,8 @@ Case is always significant and text properties are ignored."
multibyte regular expressions. As the compatibility function
for `string-search' is implemented via `string-match', these
issues are inherited."
- (when (and start-pos (< start-pos 0))
+ (when (and start-pos (or (< (length haystack) start-pos)
+ (< start-pos 0)))
(signal 'args-out-of-range (list start-pos)))
(save-match-data
(let ((case-fold-search nil))
diff --git a/compat-tests.el b/compat-tests.el
index 42e1f9197a..8d30f24d13 100644
--- a/compat-tests.el
+++ b/compat-tests.el
@@ -193,18 +193,18 @@ being compared against."
(apply #'string (number-sequence ?a ?z))))
(ought 2 "a\U00010f98z" "a\U00010f98a\U00010f98z")
(expect (args-out-of-range -1) "a" "abc" -1)
- (expect (args-out-of-range "abc" 4) "a" "abc" 4)
- (expect (args-out-of-range "abc" 100000000000)
+ (expect (args-out-of-range 4) "a" "abc" 4)
+ (expect (args-out-of-range 100000000000)
"a" "abc" 100000000000)
(ought nil "a" "aaa" 3)
(ought nil "aa" "aa" 1)
(ought nil "\0" "")
(ought 0 "" "")
- (expect (args-out-of-range "" 1) "" "" 1)
+ (expect (args-out-of-range 1) "" "" 1)
(ought 0 "" "abc")
(ought 2 "" "abc" 2)
(ought 3 "" "abc" 3)
- (expect (args-out-of-range "abc" 4) "" "abc" 4)
+ (expect (args-out-of-range 4) "" "abc" 4)
(expect (args-out-of-range -1) "" "abc" -1)
(ought nil "ø" "foo\303\270")
(ought nil "\303\270" "ø")
- [elpa] externals/compat updated (c99569a419 -> 6b21a08666), ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3472e208d7 03/13: Remove duplicate string-search test block, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 7aee4b40ef 02/13: Remove duplicate ert-set-test in compat--expect, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 21c70607aa 01/13: Have minimal definitions expand to a defalias if possible, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 327cb6b6e6 04/13: Allow specifying a condition to test defaliasing prefix functions, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 12c750656c 06/13: Move assoc-delete-all to emacs-27, ELPA Syncer, 2022/03/13
- [elpa] externals/compat abb32f1b9d 05/13: Add :cond to assoc definition, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 317b88abdc 08/13: Fix args-out-of-range signal upper-bound edge case,
ELPA Syncer <=
- [elpa] externals/compat 3a6990e954 09/13: Rename named-let name in tests to avoid byte compiler warnings, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3b88489c8c 07/13: Exclude "MANUAL" from ELPA package, ELPA Syncer, 2022/03/13
- [elpa] externals/compat e5f4a546ae 10/13: Fix duplicate test name issues, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 3fa2a7477f 11/13: Avoid failing ":cond"-check if assoc-delete-all is not defined, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 6b21a08666 13/13: Update assoc-delete-all with prefix, ELPA Syncer, 2022/03/13
- [elpa] externals/compat 9e6b342095 12/13: Update MANUAL entry on assoc-delete-all, ELPA Syncer, 2022/03/13