1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-16 17:19:41 +00:00

(Faset): Allow setting a multibyte character in an

ASCII-only unibyte string.
This commit is contained in:
Kenichi Handa 2008-04-17 01:11:11 +00:00
parent 94ef4d69c1
commit 5dff5999c4
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2008-04-17 Kenichi Handa <handa@m17n.org>
* data.c (Faset): Allow setting a multibyte character in an
ASCII-only unibyte string.
* lisp.h (STRING_SET_MULTIBYTE): New macro.
2008-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
* Makefile.in: Don't use HAVE_GTK and don't -DUSE_GTK since it's now

View File

@ -2093,7 +2093,17 @@ bool-vector. IDX starts at 0. */)
CHECK_NUMBER (newelt);
if (XINT (newelt) >= 0 && ! SINGLE_BYTE_CHAR_P (XINT (newelt)))
args_out_of_range (array, newelt);
{
int i;
for (i = SBYTES (array) - 1; i >= 0; i--)
if (SREF (array, i) >= 0x80)
args_out_of_range (array, newelt);
/* ARRAY is an ASCII string. Convert it to a multibyte
string, and try `aset' again. */
STRING_SET_MULTIBYTE (array);
return Faset (array, idx, newelt);
}
SSET (array, idxval, XINT (newelt));
}