diff options
| author | Kenichi Handa | 2005-02-14 00:59:42 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-02-14 00:59:42 +0000 |
| commit | 1bd70c6e1d8bf8c2a02d68efd0fe8b4fa9bef60d (patch) | |
| tree | 5602407e28a314dd0b77a9695e0d4dce3dc16ee5 /src | |
| parent | d31fa104a1009de730e74befec2b4512b729a0c9 (diff) | |
| download | emacs-1bd70c6e1d8bf8c2a02d68efd0fe8b4fa9bef60d.tar.gz emacs-1bd70c6e1d8bf8c2a02d68efd0fe8b4fa9bef60d.zip | |
(lisp_data_to_selection_data): If OBJ is a non-ASCII
multibyte string, signal an error instead of aborting.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xselect.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c index bf37cde4d0b..8d8efd8db8a 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1908,7 +1908,12 @@ lisp_data_to_selection_data (display, obj, | |||
| 1908 | } | 1908 | } |
| 1909 | else if (STRINGP (obj)) | 1909 | else if (STRINGP (obj)) |
| 1910 | { | 1910 | { |
| 1911 | xassert (! STRING_MULTIBYTE (obj)); | 1911 | if (SCHARS (obj) < SBYTES (obj)) |
| 1912 | /* OBJ is a multibyte string containing a non-ASCII char. */ | ||
| 1913 | Fsignal (Qerror, /* Qselection_error */ | ||
| 1914 | Fcons (build_string | ||
| 1915 | ("Non-ASCII string must be encoded in advance"), | ||
| 1916 | Fcons (obj, Qnil))); | ||
| 1912 | if (NILP (type)) | 1917 | if (NILP (type)) |
| 1913 | type = QSTRING; | 1918 | type = QSTRING; |
| 1914 | *format_ret = 8; | 1919 | *format_ret = 8; |