comparison src/minibuf.c @ 25836:f540e1508f05

(Fminibuffer_complete_word): Calculate string byte size correctly.
author Kenichi Handa <handa@m17n.org>
date Thu, 30 Sep 1999 04:19:45 +0000
parents 7796a636f039
children 2a7f35e0072b
comparison
equal deleted inserted replaced
25835:265202db376b 25836:f540e1508f05
1831 1831
1832 /* Now find first word-break in the stuff found by completion. 1832 /* Now find first word-break in the stuff found by completion.
1833 i gets index in string of where to stop completing. */ 1833 i gets index in string of where to stop completing. */
1834 { 1834 {
1835 int len, c; 1835 int len, c;
1836 1836 int bytes = STRING_BYTES (XSTRING (completion));
1837 completion_string = XSTRING (completion)->data; 1837 completion_string = XSTRING (completion)->data;
1838 for (; i_byte < STRING_BYTES (XSTRING (completion)); i_byte += len, i++) 1838 for (; i_byte < STRING_BYTES (XSTRING (completion)); i_byte += len, i++)
1839 { 1839 {
1840 c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, 1840 c = STRING_CHAR_AND_LENGTH (completion_string + i_byte,
1841 XSTRING (completion)->size - i_byte, 1841 bytes - i_byte,
1842 len); 1842 len);
1843 if (SYNTAX (c) != Sword) 1843 if (SYNTAX (c) != Sword)
1844 { 1844 {
1845 i_byte += len; 1845 i_byte += len;
1846 i++; 1846 i++;