aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>1998-10-14 07:17:22 +0000
committerKenichi Handa <[email protected]>1998-10-14 07:17:22 +0000
commit95b8aba74b18f5bcfc1410e3cd653b50c37ae301 (patch)
treebea45e50c3f20bfccaa576b80ea05c7379cd263d /src/fns.c
parent0cb0ba6c86cbffb5cd2f5df7f96a7ad848fd351c (diff)
(Ffillarray): Fix previous change.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/fns.c b/src/fns.c
index 5414e991cf..c802c5c803 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1794,14 +1794,16 @@ ARRAY is a vector, string, char-table, or bool-vector.")
int len = CHAR_STRING (charval, workbuf, str);
int size_byte = STRING_BYTES (XSTRING (array));
unsigned char *p1 = p, *endp = p + size_byte;
- int this_len, i;
+ int i;
- for (i = 0; i < size; i++)
- {
- this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1);
- if (len != this_len)
- error ("Attempt to change byte length of a string");
- }
+ if (size != size_byte)
+ while (p1 < endp)
+ {
+ int this_len = MULTIBYTE_FORM_LENGTH (p1, endp - p1);
+ if (len != this_len)
+ error ("Attempt to change byte length of a string");
+ p1 += this_len;
+ }
for (i = 0; i < size_byte; i++)
*p++ = str[i % len];
}