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:
parent
94ef4d69c1
commit
5dff5999c4
@ -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
|
||||
|
12
src/data.c
12
src/data.c
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user