aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-04-17 01:11:11 +0000
committerKenichi Handa2008-04-17 01:11:11 +0000
commit5dff5999c49d4c7527bca8758b99a21ab8c7e76b (patch)
treee404cb8f6839e277126f6741f9a8f7bf29eabc8b /src
parent94ef4d69c135f6d58fe0a79bd6747c509931fc5c (diff)
downloademacs-5dff5999c49d4c7527bca8758b99a21ab8c7e76b.tar.gz
emacs-5dff5999c49d4c7527bca8758b99a21ab8c7e76b.zip
(Faset): Allow setting a multibyte character in an
ASCII-only unibyte string.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/data.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index dd0d8cd266f..527ff3c689d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12008-04-17 Kenichi Handa <handa@m17n.org>
2
3 * data.c (Faset): Allow setting a multibyte character in an
4 ASCII-only unibyte string.
5
6 * lisp.h (STRING_SET_MULTIBYTE): New macro.
7
12008-04-16 Stefan Monnier <monnier@iro.umontreal.ca> 82008-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * Makefile.in: Don't use HAVE_GTK and don't -DUSE_GTK since it's now 10 * Makefile.in: Don't use HAVE_GTK and don't -DUSE_GTK since it's now
diff --git a/src/data.c b/src/data.c
index 6b1a9fc8860..cb9d210c628 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2093,7 +2093,17 @@ bool-vector. IDX starts at 0. */)
2093 CHECK_NUMBER (newelt); 2093 CHECK_NUMBER (newelt);
2094 2094
2095 if (XINT (newelt) >= 0 && ! SINGLE_BYTE_CHAR_P (XINT (newelt))) 2095 if (XINT (newelt) >= 0 && ! SINGLE_BYTE_CHAR_P (XINT (newelt)))
2096 args_out_of_range (array, newelt); 2096 {
2097 int i;
2098
2099 for (i = SBYTES (array) - 1; i >= 0; i--)
2100 if (SREF (array, i) >= 0x80)
2101 args_out_of_range (array, newelt);
2102 /* ARRAY is an ASCII string. Convert it to a multibyte
2103 string, and try `aset' again. */
2104 STRING_SET_MULTIBYTE (array);
2105 return Faset (array, idx, newelt);
2106 }
2097 SSET (array, idxval, XINT (newelt)); 2107 SSET (array, idxval, XINT (newelt));
2098 } 2108 }
2099 2109