Re: patch for the viewer in mc-4.5.99
- From: Pavel Roskin <proski gnu org>
- To: Roland Illig <roland illig gmx de>
- Cc: mc-devel gnome org
- Subject: Re: patch for the viewer in mc-4.5.99
- Date: Fri, 26 Jul 2002 13:20:09 -0400 (EDT)
Hi, Roland!
> The patch adds more strictness to the nroff parser. As a result,
> binary files will contain less "bold" letters than before.
Thanks! Applied after massive changes.
> - && is_printable (get_byte (view, from - 1)))
> + && is_printable (get_byte (view, from - 1)) &&
> + (get_byte(view, from + 1) == get_byte(view,
> from - 1)
> + || get_byte(view, from + 1) == '_'
This case (symbol, backspace, underscore) doesn't work, as you could have
noticed if you had tested your patch a little bit more. MC displays bold
underscore. It never worked right. Adding proper support for this would
require quite a lot of code, and is not worth the trouble, since nroff
always puts the underscore before the backspace. Now this case is not
interpreted, which is much better than a string of underscores.
The number of get_byte() calls becomes too large, so I added two variables
to hold the previous and the next character.
> - if (!is_printable (c))
> - c = '.';
> -
> - view_add_character (view, c);
> + if (!is_printable (c)){
> + view_add_character(view, '.');
> + } else{
> + view_add_character (view, c);
> + }
I believe, this part is not necessary, so I removed it.
--
Regards,
Pavel Roskin
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]