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

Re: Bug#363250: general: Custom PAGER gives error on sid, but works on sarge



Scripsit Loïc Minier <lool+debian@via.ecp.fr>

>  I suggest you use:
>     export PAGER="sh -c \"col -b | view -c 'set ft=man nomod nolist titlestring=MANPAGE' -\""
>
>  which explicitely calls sh -c to handle pipes and quotes in the
>  expected way.

Policy does not really specify how to handle $PAGER and its friends,
but I have always assumed that it was OK for a package to do things
like (error checking omitted for clarity):

    if( fork() == 0 ) {
        char *pager = getenv("PAGER");
        if( pager == NULL ) pager = "/usr/bin/pager" ;
        execlp(getenv("PAGER"),filename,NULL);
    }
    wait(NULL);

In that case, PAGER has to be set to just the name of a program, with
no parameters or metacharacters embedded.

>  You may also use your own /usr/local/bin/pager with:
>     #!/bin/sh

>     col -b | view -c 'set ft=man nomod nolist titlestring=MANPAGE' -
>  and with PAGER=/usr/local/bin/pager.

I think that is the more robust way for a user to do such things, and
the way that should be documented.

>  I am reassigning to man for the man manpage to be clarified with
>  respect to the way $PAGER is called.

Is this a man-specific problem? I would say it is a general problem of
policy being vague.

-- 
Henning Makholm           "There were few families that didn't have at least
                         one hopeful who, from Reading Day on, was the great
                       hope because of the way he handled his trisyllabics."



Reply to: