[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 3af27a4b815: Improve commentary in nsfns.m
From: |
Po Lu |
Subject: |
emacs-29 3af27a4b815: Improve commentary in nsfns.m |
Date: |
Thu, 20 Jul 2023 04:01:58 -0400 (EDT) |
branch: emacs-29
commit 3af27a4b815906c2ee38cbaf3a765289b3df061a
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Improve commentary in nsfns.m
* src/nsfns.m (lispString): Avoid C++ comment and make the
commentary actually relevant to the reason `make_string' is
used.
---
src/nsfns.m | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/nsfns.m b/src/nsfns.m
index 5ae2cc77bb2..fe565a423aa 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3829,7 +3829,11 @@ all_nonzero_ascii (unsigned char *str, ptrdiff_t n)
/* Make a Lisp string from an NSString. */
- (Lisp_Object)lispString
{
- // make_string behaves predictably and correctly with UTF-8 input.
+ /* `make_string' creates a string with a given length, instead of
+ searching for a trailing NULL byte to determine its end. This is
+ important because this function is called to convert NSString
+ objects containing clipboard data, which can contain NUL bytes,
+ into Lisp strings. (bug#64697) */
return make_string ([self UTF8String],
[self lengthOfBytesUsingEncoding: NSUTF8StringEncoding]);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-29 3af27a4b815: Improve commentary in nsfns.m,
Po Lu <=