unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64697: 29.0.92: cannot paste NUL on macOS (regression from Emacs 28)
@ 2023-07-18  8:30 Mattias Engdegård
  2023-07-18  9:22 ` Alan Third
  2023-07-18 11:28 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Mattias Engdegård @ 2023-07-18  8:30 UTC (permalink / raw)
  To: 64697; +Cc: Alan Third

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

In Emacs 29, text pasted from the clipboard on macOS will be truncated if containing NULs.

Reproduction: copy text with NUL in the middle from Emacs 28 (or any other application), and paste into Emacs 29.

This was probably caused by 7e3c2b553f, where construction of a Lisp string was changed from make_string to build_string.

Suggested patch attached. If valid, would it qualify for emacs-29?


[-- Attachment #2: lispString.diff --]
[-- Type: application/octet-stream, Size: 453 bytes --]

diff --git a/src/nsfns.m b/src/nsfns.m
index 8804a7df7cf..d7ad0fa8341 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3829,7 +3829,8 @@ handled fairly well by the NS libraries (displayed with distinct
 /* Make a Lisp string from an NSString.  */
 - (Lisp_Object)lispString
 {
-  return build_string ([self UTF8String]);
+  return make_string ([self UTF8String],
+                      [self lengthOfBytesUsingEncoding: NSUTF8StringEncoding]);
 }
 @end
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-19 17:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18  8:30 bug#64697: 29.0.92: cannot paste NUL on macOS (regression from Emacs 28) Mattias Engdegård
2023-07-18  9:22 ` Alan Third
2023-07-18 11:31   ` Eli Zaretskii
2023-07-18 11:28 ` Eli Zaretskii
2023-07-18 12:00   ` Mattias Engdegård
2023-07-18 13:02     ` Eli Zaretskii
2023-07-18 13:56       ` Mattias Engdegård
2023-08-19 17:34         ` Mattias Engdegård

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).