changeset 60030:e41b38ec1a82

(lisp_data_to_selection_data): If OBJ is a non-ASCII multibyte string, signal an error instead of aborting.
author Kenichi Handa <handa@m17n.org>
date Mon, 14 Feb 2005 00:59:42 +0000
parents 210af0ad3d35
children 8d84cdf36525
files src/xselect.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/xselect.c	Sun Feb 13 08:47:45 2005 +0000
+++ b/src/xselect.c	Mon Feb 14 00:59:42 2005 +0000
@@ -1908,7 +1908,12 @@
     }
   else if (STRINGP (obj))
     {
-      xassert (! STRING_MULTIBYTE (obj));
+      if (SCHARS (obj) < SBYTES (obj))
+	/* OBJ is a multibyte string containing a non-ASCII char.  */
+	Fsignal (Qerror, /* Qselection_error */
+		 Fcons (build_string
+			("Non-ASCII string must be encoded in advance"),
+			Fcons (obj, Qnil)));
       if (NILP (type))
 	type = QSTRING;
       *format_ret = 8;