From a03de1e2a33a35caf2715b2645aef0a52072b4b2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 6 Feb 2019 17:31:26 +0200 Subject: [PATCH] Prevent segfaults when running inside docker * src/coding.c (syms_of_coding): New symbol Qus_ascii. (reset_coding_after_pdumper_load): Call set-safe-terminal-system-internal to set up safe_terminal_coding after restoring from pdump file. Reported by Philippe Vaucher . --- src/coding.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/coding.c b/src/coding.c index 6de8dcd1ffe..e470757f92e 100644 --- a/src/coding.c +++ b/src/coding.c @@ -10831,6 +10831,7 @@ syms_of_coding (void) DEFSYM (Qundecided, "undecided"); DEFSYM (Qno_conversion, "no-conversion"); DEFSYM (Qraw_text, "raw-text"); + DEFSYM (Qus_ascii, "us-ascii"); DEFSYM (Qiso_2022, "iso-2022"); @@ -11341,4 +11342,9 @@ reset_coding_after_pdumper_load (void) setup_coding_system (CODING_ID_NAME (id), this); } } + /* In temacs the below is done by mule-conf.el, because we need to + define us-ascii first. But in dumped Emacs us-ascii is restored + by the above loop, and mule-conf.el will not be loaded, so we set + it up now; otherwise safe_terminal_coding will remain zeroed. */ + Fset_safe_terminal_coding_system_internal (Qus_ascii); } -- 2.39.5