]> git.eshelyaron.com Git - emacs.git/commitdiff
(Ffillarray): Fix previous change.
authorKenichi Handa <handa@m17n.org>
Wed, 14 Oct 1998 07:17:22 +0000 (07:17 +0000)
committerKenichi Handa <handa@m17n.org>
Wed, 14 Oct 1998 07:17:22 +0000 (07:17 +0000)
src/fns.c

index 5414e991cfc4142a2ddde543cc0982cd99ea24c1..c802c5c803a62a40c0642cb289260c22ab23592e 100644 (file)
--- 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];
        }