aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorMattias EngdegÄrd2020-04-05 11:27:36 +0200
committerMattias EngdegÄrd2020-04-05 11:39:52 +0200
commit962562cde45071f74a37854a299e88470a4ecd49 (patch)
tree730aa974d0aa77499d541e1d10812837ab1e7329 /src/coding.c
parentbec5cfee7660f6e283efbd30a693a6f8e9ea46b8 (diff)
downloademacs-962562cde45071f74a37854a299e88470a4ecd49.tar.gz
emacs-962562cde45071f74a37854a299e88470a4ecd49.zip
Fix inverted NOCOPY encode/decode parameter (bug#40407)
In {encode,decode}-coding-string, the NOCOPY parameter had the opposite effect to what was intended and documented. This 18 year old bug (introduced in 4031e2bf0a) only affected calls with CODING-SYSTEM being nil. * src/coding.c (code_convert_string): Correct use of NOCOPY. * test/src/coding-tests.el (coding-nocopy-trivial): New test.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coding.c b/src/coding.c
index f0fc37dbdfa..1049f1b755a 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -9485,7 +9485,7 @@ code_convert_string (Lisp_Object string, Lisp_Object coding_system,
9485 if (! norecord) 9485 if (! norecord)
9486 Vlast_coding_system_used = Qno_conversion; 9486 Vlast_coding_system_used = Qno_conversion;
9487 if (NILP (dst_object)) 9487 if (NILP (dst_object))
9488 return (nocopy ? Fcopy_sequence (string) : string); 9488 return nocopy ? string : Fcopy_sequence (string);
9489 } 9489 }
9490 9490
9491 if (NILP (coding_system)) 9491 if (NILP (coding_system))