Mercurial > emacs
diff src/xselect.c @ 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 | 22a410b2373b |
| children | dd37bedfb1f4 |
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;
