aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.c
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/data.c
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/data.c')
-rw-r--r--src/data.c12
1 files changed, 11 insertions, 1 deletions
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