mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Fix replace-in-string infloop with empty pattern string (bug#43598)
* lisp/subr.el (replace-in-string): Raise an error if FROMSTRING is empty. * test/lisp/subr-tests.el (replace-in-string): Add test case.
This commit is contained in:
parent
d964375ad3
commit
8a253a96a0
2 changed files with 5 additions and 1 deletions
|
|
@ -464,7 +464,9 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
|
|||
(should (equal (replace-in-string "\377" "x" "a\377b")
|
||||
"axb"))
|
||||
(should (equal (replace-in-string "\377" "x" "a\377ø")
|
||||
"axø")))
|
||||
"axø"))
|
||||
|
||||
(should-error (replace-in-string "" "x" "abc")))
|
||||
|
||||
(provide 'subr-tests)
|
||||
;;; subr-tests.el ends here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue