From 6d882a3fdd5b35181b301a2b1db32908c2b7953a Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 29 Oct 2024 16:08:45 +0300 Subject: fixed (search all) crashes before invocations of (closes #26) * There was some boilerplate code missing in teco_state_search_all_initial(), that is present in teco_state_search_initial(). * Perhaps there should be a common function to avoid redundancies? * This will also fix the initialization of the string argument codepage for . --- src/search.c | 7 +++++++ tests/testsuite.at | 1 + 2 files changed, 8 insertions(+) diff --git a/src/search.c b/src/search.c index 0d04895..14a8540 100644 --- a/src/search.c +++ b/src/search.c @@ -830,6 +830,13 @@ teco_state_search_all_initial(teco_machine_main_t *ctx, GError **error) if (ctx->mode > TECO_MODE_NORMAL) return TRUE; + teco_machine_stringbuilding_set_codepage(&ctx->expectstring.machine, + teco_interface_get_codepage()); + + if (G_UNLIKELY(!teco_search_qreg_machine)) + teco_search_qreg_machine = teco_machine_qregspec_new(TECO_QREG_REQUIRED, ctx->qreg_table_locals, + ctx->parent.must_undo); + teco_undo_object_parameters_push(&teco_search_parameters); teco_search_parameters.dot = teco_interface_ssm(SCI_GETCURRENTPOS, 0, 0); diff --git a/tests/testsuite.at b/tests/testsuite.at index aba51a5..01ca664 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -171,6 +171,7 @@ AT_CLEANUP AT_SETUP([Search on new empty document]) AT_CHECK([$SCITECO -e ":@S/foo/\"S(0/0)'"], 0, ignore, ignore) +AT_CHECK([$SCITECO -e ":@N/foo/\"S(0/0)'"], 0, ignore, ignore) AT_CLEANUP AT_SETUP([Memory limiting during spawning]) -- cgit v1.2.3