APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1488583345 0
# Fri Mar 03 23:22:25 2017 +0000
# Node ID 0058a7e5c57777d2182ae59044d1e736e714d3f2
# Parent 6a06b0c47664b3d83e9c6261d0a8bb1d0dae0620
If START is specified, adjust the returned value accordingly, #'string-match-p
src/ChangeLog addition:
2017-03-03 Aidan Kehoe <kehoea(a)parhasard.net>
* search.c (Fstring_match_p):
If START is specified, adjust the returned value accordingly.
tests/ChangeLog addition:
2017-03-03 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/regexp-tests.el:
Check that START is taken into account with a successful result in
#'string-match-p.
diff -r 6a06b0c47664 -r 0058a7e5c577 src/ChangeLog
--- a/src/ChangeLog Fri Mar 03 20:39:24 2017 +0000
+++ b/src/ChangeLog Fri Mar 03 23:22:25 2017 +0000
@@ -1,3 +1,8 @@
+2017-03-03 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * search.c (Fstring_match_p):
+ If START is specified, adjust the returned value accordingly.
+
2017-02-20 Aidan Kehoe <kehoea(a)parhasard.net>
* elhash.c:
diff -r 6a06b0c47664 -r 0058a7e5c577 src/search.c
--- a/src/search.c Fri Mar 03 20:39:24 2017 +0000
+++ b/src/search.c Fri Mar 03 23:22:25 2017 +0000
@@ -652,7 +652,7 @@
!NILP (bufp->case_fold_search),
ERROR_ME, 0);
return result < 0 ? Qnil
- : make_fixnum (string_index_byte_to_char (string, result));
+ : make_fixnum (string_index_byte_to_char (string, result + bstart));
}
diff -r 6a06b0c47664 -r 0058a7e5c577 tests/ChangeLog
--- a/tests/ChangeLog Fri Mar 03 20:39:24 2017 +0000
+++ b/tests/ChangeLog Fri Mar 03 23:22:25 2017 +0000
@@ -1,3 +1,9 @@
+2017-03-03 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * automated/regexp-tests.el:
+ Check that START is taken into account with a successful result in
+ #'string-match-p.
+
2017-02-18 Aidan Kehoe <kehoea(a)parhasard.net>
* automated/regexp-tests.el:
diff -r 6a06b0c47664 -r 0058a7e5c577 tests/automated/regexp-tests.el
--- a/tests/automated/regexp-tests.el Fri Mar 03 20:39:24 2017 +0000
+++ b/tests/automated/regexp-tests.el Fri Mar 03 23:22:25 2017 +0000
@@ -69,6 +69,9 @@
(Assert (string-match "�" "�"))
(Assert (not (string-match "�" "�")))
+ (Assert (eql (string-match-p "=[0-9a-f]" "=00=af" (length
"=00"))
+ (length "=00")))
+
(let ((preserve (list 0 most-positive-fixnum (/ most-positive-fixnum 4)
(/ most-positive-fixnum 2))))
(store-match-data preserve)
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)
Show replies by date