aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/spawn.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-10-16 11:40:52 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-10-16 11:40:52 +0300
commitd714bb48a4b8629f6345a28bc21a24537207176b (patch)
treed605b57c182741590377edae8ced7e693000523d /src/spawn.c
parentd556aee67e615b48c25861741d28d103109235e3 (diff)
downloadsciteco-d714bb48a4b8629f6345a28bc21a24537207176b.tar.gz
fixup: use teco_machine_t::must_undo instead of trying to identify the current state machine
* The previous solution was not wrong, but unnecessarily complex. We already have a flag for exactly this purpose. * Avoid redundancies by introducing teco_machine_stringbuilding_set_codepage().
Diffstat (limited to 'src/spawn.c')
-rw-r--r--src/spawn.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/spawn.c b/src/spawn.c
index cb1ef75..e6d620c 100644
--- a/src/spawn.c
+++ b/src/spawn.c
@@ -43,7 +43,6 @@
#include "core-commands.h"
#include "qreg-commands.h"
#include "error.h"
-#include "cmdline.h"
#include "spawn.h"
/*
@@ -168,12 +167,9 @@ teco_state_execute_initial(teco_machine_main_t *ctx, GError **error)
/*
* Command-lines and file names are always assumed to be UTF-8,
* unless we set TECO_ED_DEFAULT_ANSI.
- *
- * NOTE: This is not safe to undo in macro calls.
*/
- if (ctx == &teco_cmdline.machine)
- teco_undo_guint(ctx->expectstring.machine.codepage);
- ctx->expectstring.machine.codepage = teco_default_codepage();
+ teco_machine_stringbuilding_set_codepage(&ctx->expectstring.machine,
+ teco_default_codepage());
if (!teco_expressions_eval(FALSE, error))
return FALSE;