comparison src/text.c @ 841:44478bd99873

[xemacs-hg @ 2002-05-14 15:15:58 by ben] crash fixes text.c: Fix bug leading to crashes with multibyte text. win32.c: Fix crash due to errant xfree(). xemacs.mak: Run tests with the packages so we don't get errors about advice not present, etc.
author ben
date Tue, 14 May 2002 15:16:08 +0000
parents 6728e641994e
children e7ee5f8bde58
comparison
equal deleted inserted replaced
840:1e4e42de23d5 841:44478bd99873
1187 *src_used += the_src_used; 1187 *src_used += the_src_used;
1188 if (dst) 1188 if (dst)
1189 { 1189 {
1190 dst += the_dst_used; 1190 dst += the_dst_used;
1191 dstlen -= the_dst_used; 1191 dstlen -= the_dst_used;
1192 if (!dstlen) 1192 /* Stop if we didn't use all of the source text. Also stop
1193 if the destination is full. We need the first test because
1194 there might be a couple bytes left in the destination, but
1195 not enough to fit a full character. The first test will in
1196 fact catch the vast majority of cases where the destination
1197 is empty, too -- but in case the destination holds *exactly*
1198 the run length, we put in the second check. (It shouldn't
1199 really matter though -- next time through we'll just get a
1200 0.) */
1201 if (the_src_used < runlen || !dstlen)
1193 break; 1202 break;
1194 } 1203 }
1195 } 1204 }
1196 } 1205 }
1197 1206