On Wed, Oct 22, 2003 at 01:14:58AM +0300, Martin Vermeer wrote: > On Tue, Oct 21, 2003 at 07:17:22PM +0200, Andre Poenitz spake thusly: > > > > > - if (point == last || chunkwidth >= width - left) > > - point = (pos < i) ? i - 1 : i; > > - break; > > + if (point == last || chunkwidth >= width - left) { > > + if (pos < i) { > > + point = i - 1; > > + break; > > + } > > + } > > > > No good. > > > > Andre' > > Grmpf indeed. > > Your patch is close but I think you need the following: > > if (point == last || chunkwidth >= width - left) { > if (pos < i) { > point = i - 1; > - break; <-- *don't* delete this > } > } > + if (i + 1 < last) <-- needed to prevent trailing empty row > creation after wide inset > + break; <-- OK. > > This works perfectly on the file José sent me.
Why this restriction to i + 1 < last? The original code had an unconditional 'break'. As John said: Be _very_ careful in this area. Andre'