comparison src/misc1.c @ 1617:5f0c7aae4da2 v7.1.330

updated for version 7.1-330
author vimboss
date Sat, 21 Jun 2008 14:30:28 +0000
parents d976f4da2a4d
children 18ee39301b82
comparison
equal deleted inserted replaced
1616:dbef8434a2ea 1617:5f0c7aae4da2
1878 { 1878 {
1879 int i; 1879 int i;
1880 # ifdef FEAT_MBYTE 1880 # ifdef FEAT_MBYTE
1881 int n; 1881 int n;
1882 1882
1883 for (i = 0; i < len; i += n) 1883 if (has_mbyte)
1884 { 1884 for (i = 0; i < len; i += n)
1885 n = (*mb_ptr2len)(p + i); 1885 {
1886 ins_char_bytes(p + i, n); 1886 if (enc_utf8)
1887 } 1887 /* avoid reading past p[len] */
1888 # else 1888 n = utfc_ptr2len_len(p + i, len - i);
1889 for (i = 0; i < len; ++i) 1889 else
1890 ins_char(p[i]); 1890 n = (*mb_ptr2len)(p + i);
1891 ins_char_bytes(p + i, n);
1892 }
1893 else
1891 # endif 1894 # endif
1895 for (i = 0; i < len; ++i)
1896 ins_char(p[i]);
1892 } 1897 }
1893 #endif 1898 #endif
1894 1899
1895 /* 1900 /*
1896 * Insert or replace a single character at the cursor position. 1901 * Insert or replace a single character at the cursor position.