Thanks for the fast reply,
>
> You got lucky. Code such as the following presumes powers of two.
>
your're right. I only checked some of the changed files. I guess there must
be some where it didn't work.
>
> What is needed instead is something like:
>
> col = ((int)(col/tablength)+1)*tablength;
>
I didn't look into the code before, cause I hoped that the limitation wasn't
built into the source code. Now I understand why removing the check isn't
enough.
I added the above line and as far as my tests and my understanding go it
works fine.
I'm not sure if the following has to be changed to, cause I'm not "in the
code" yet.
while ((diff|(tablength-1))<col) {
outdata[o++]=(byte)'\t';
line-=(tablength-1)-(diff&(tablength-1));
diff=o-line;
};
> Which is a bit less efficient. At the time I wrote the
> original code that
> this is based on (over a decade ago), I was very concerned about such
> things.
I left the optimization phase behind me as well. Cause as Kent Beck puts
it in XP it's something that mostly causes more trouble than it saves.
Thanks Thomas