aboutsummaryrefslogtreecommitdiffstats
path: root/src/search.c
diff options
context:
space:
mode:
authorPaul Eggert2019-09-22 10:43:21 -0700
committerPaul Eggert2019-09-22 10:45:14 -0700
commit2f600e97e7ca43965f55f019759582d93d8bca73 (patch)
treed885dcef77f04a60da6cec56a2750b19a8e64192 /src/search.c
parentdddff96a585531608d5e8d27375a6363679a9fb5 (diff)
downloademacs-2f600e97e7ca43965f55f019759582d93d8bca73.tar.gz
emacs-2f600e97e7ca43965f55f019759582d93d8bca73.zip
Avoid crashes when casifying noncontiguous regions
This is a followon fix for Bug#37477. * lisp/simple.el (region-extract-function): Use setq here, since the var is now defined in C code. * src/casefiddle.c (casify_pnc_region): New function. (Fupcase_region, Fdowncase_region, Fcapitalize_region) (Fupcase_initials_region): Use it. (Fupcase_initials_region): Add region-noncontiguous-p flag for consistency with the others. All uses changed. (syms_of_casefiddle): Define Qbounds, Vregion_extract_function. * src/insdel.c (prepare_to_modify_buffer_1): * src/keyboard.c (command_loop_1): Use Vregion_extraction_function. * src/insdel.c (syms_of_insdel): No need to define Qregion_extract_function. * test/src/casefiddle-tests.el (casefiddle-oldfunc): New var. (casefiddle-loopfunc, casefiddle-badfunc): New functions. (casefiddle-invalid-region-extract-function): New test.
Diffstat (limited to 'src/search.c')
-rw-r--r--src/search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index 9b674a58102..1e57d2ecbe5 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2739,7 +2739,7 @@ since only regular expressions have distinguished subexpressions. */)
2739 Qnil); 2739 Qnil);
2740 else if (case_action == cap_initial) 2740 else if (case_action == cap_initial)
2741 Fupcase_initials_region (make_fixnum (search_regs.start[sub]), 2741 Fupcase_initials_region (make_fixnum (search_regs.start[sub]),
2742 make_fixnum (newpoint)); 2742 make_fixnum (newpoint), Qnil);
2743 2743
2744 /* The replace_range etc. functions can trigger modification hooks 2744 /* The replace_range etc. functions can trigger modification hooks
2745 (see signal_before_change and signal_after_change). Try to error 2745 (see signal_before_change and signal_after_change). Try to error