Ticket #1539: mc-1539-man-pipeline-v2.patch

File mc-1539-man-pipeline-v2.patch, 931 bytes (added by egmont, 10 years ago)

Demo fix v2

  • misc/ext.d/text.sh.in

    diff --git a/misc/ext.d/text.sh.in b/misc/ext.d/text.sh.in
    index 99c8bee..858a9cb 100644
    a b do_view_action() { 
    4545            cat "${MC_EXT_FILENAME}" 
    4646            ;; 
    4747        *) 
    48             { zsoelim "${MC_EXT_FILENAME}" 2>/dev/null || cat "${MC_EXT_FILENAME}"; } | nroff @MAN_FLAGS@ @MANDOC@ 
     48            MANROFFOPT=-c MAN_KEEP_FORMATTING=1 man -P cat -l "${MC_EXT_FILENAME}" 
    4949            ;; 
    5050        esac 
    5151        ;; 
    do_view_action() { 
    6464            ${unpacker} "${MC_EXT_FILENAME}" 
    6565            ;; 
    6666        *) 
    67             ${unpacker} "${MC_EXT_FILENAME}" | nroff @MAN_FLAGS@ @MANDOC@ 
     67            # "man" takes care of uncompressing. 
     68            # This way the stdin is left intact so the correct width is used. 
     69            MANROFFOPT=-c MAN_KEEP_FORMATTING=1 man -P cat -l "${MC_EXT_FILENAME}" 
    6870            ;; 
    6971        esac 
    7072        ;;