From d03f2a6ee942882c5bc78226b4730dac6f1d0916 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 10 Feb 2021 20:04:26 +0200 Subject: [PATCH] Avoid assertion violation in callproc.c * src/callproc.c (call_process): Avoid assertion violation when DESTINATION is a cons cell '(:file . "FOO")'. (Bug#46426) --- src/callproc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/callproc.c b/src/callproc.c index 5b1d8bfb765..3eac38d375a 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -394,7 +394,11 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd, /* If the buffer is (still) a list, it might be a (:file "file") spec. */ if (CONSP (buffer) && EQ (XCAR (buffer), QCfile)) { - output_file = Fexpand_file_name (XCAR (XCDR (buffer)), + Lisp_Object ofile = XCDR (buffer); + if (CONSP (ofile)) + ofile = XCAR (ofile); + CHECK_STRING (ofile); + output_file = Fexpand_file_name (ofile, BVAR (current_buffer, directory)); CHECK_STRING (output_file); buffer = Qnil; -- 2.39.2