changeset 89526:58eb89f2fdfc

(Faset): Check newelt by CHECK_CHARACTER. Don't change multibyteness of the result when newelt is an 8-bit character.
author Kenichi Handa <handa@m17n.org>
date Fri, 26 Sep 2003 11:20:13 +0000
parents 1b757cdb6144
children 7ca60ab7a039
files src/data.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/data.c	Thu Sep 18 19:43:25 2003 +0000
+++ b/src/data.c	Fri Sep 26 11:20:13 2003 +0000
@@ -1929,7 +1929,7 @@
 
       if (idxval < 0 || idxval >= SCHARS (array))
 	args_out_of_range (array, idx);
-      CHECK_NUMBER (newelt);
+      CHECK_CHARACTER (newelt);
 
       nbytes = SBYTES (array);
 
@@ -1966,7 +1966,8 @@
 	args_out_of_range (array, idx);
       CHECK_NUMBER (newelt);
 
-      if (XINT (newelt) < 0 || ASCII_CHAR_P (XINT (newelt)))
+      if (XINT (newelt) < 0 || ASCII_CHAR_P (XINT (newelt))
+	  || CHAR_BYTE8_P (XINT (newelt)))
 	SSET (array, idxval, XINT (newelt));
       else
 	{