diff options
| author | Pip Cet <pipcet@protonmail.com> | 2026-05-24 12:05:50 +0000 |
|---|---|---|
| committer | Pip Cet <pipcet@protonmail.com> | 2026-05-24 12:32:28 +0000 |
| commit | b72dcebdabfc3b7b28c9542633bd48b43bcc6365 (patch) | |
| tree | c690a27d99ea966a1b3f1721caeea37919f74c5e /src | |
| parent | 7f8ac8bf6f04045a676543862098c47bbf732f9e (diff) | |
Avoid crash in self-insert-command with non-ASCII auto-fill
* src/cmds.c (internal_self_insert): If the autofill function changed
the newline character we inserted, don't attempt to restore point.
* test/src/cmds-tests.el (self-insert-nonascii-autofill): New.
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmds.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmds.c b/src/cmds.c index e9dee5ed2e3..9ca9a6d28de 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -489,7 +489,7 @@ internal_self_insert (int c, EMACS_INT n) SET_PT_BOTH (PT - 1, PT_BYTE - 1); auto_fill_result = call0 (Qinternal_auto_fill); /* Test PT < ZV in case the auto-fill-function is strange. */ - if (c == '\n' && PT < ZV) + if (c == '\n' && PT < ZV && FETCH_BYTE (PT) == '\n') SET_PT_BOTH (PT + 1, PT_BYTE + 1); if (!NILP (auto_fill_result)) hairy = 2; |
