patch for the viewer in mc-4.5.99



The patch adds more strictness to the nroff parser. As a result, 
binary files will contain less "bold" letters than before.

It is appendended because of the line breaks that occur in mails. 
It looks like:

--- mc-4.5.99a.old/src/view.c   2002-07-20 06:13:16.000000000 
+0200
+++ mc-4.5.99a/src/view.c       2002-07-26 18:54:53.000000000 
+0200
@@ -972,7 +972,10 @@
                if (from + 1 < view->last_byte
                    && is_printable (get_byte (view, from + 1)) &&
                    from > view->first
-                   && 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) == '_'
+                   || get_byte(view, from - 1) == '_'))
                {
                    if (col <= frame_shift){
                        /* So it has to be wrap_mode - do not 
need to check for it */
@@ -1007,10 +1010,11 @@
                c = conv_displ[ c ];
 #endif
 
-                       if (!is_printable (c))
-                   c = '.';
-
-               view_add_character (view, c);
+                       if (!is_printable (c)){
+                   view_add_character(view, '.');
+               } else{
+                   view_add_character (view, c);
+               }
                    }
            col++;
            if (boldflag){
--- mc-4.5.99a.old/src/view.c	2002-07-20 06:13:16.000000000 +0200
+++ mc-4.5.99a/src/view.c	2002-07-26 18:54:53.000000000 +0200
@@ -972,7 +972,10 @@
 	    	if (from + 1 < view->last_byte
 		    && is_printable (get_byte (view, from + 1)) &&
 	    	    from > view->first
-		    && 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) == '_'
+		    || get_byte(view, from - 1) == '_'))
 		{
 		    if (col <= frame_shift){
 		    	/* So it has to be wrap_mode - do not need to check for it */
@@ -1007,10 +1010,11 @@
 		c = conv_displ[ c ];
 #endif
 
-       		if (!is_printable (c))
-		    c = '.';
-
-		view_add_character (view, c);
+       		if (!is_printable (c)){
+		    view_add_character(view, '.');
+		} else{
+		    view_add_character (view, c);
+		}
        	    } 
 	    col++;
 	    if (boldflag){


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]