groff
[Top][All Lists]
Advanced

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

Re: [Groff] .rd request


From: Ralph Corderoy
Subject: Re: [Groff] .rd request
Date: Fri, 11 Jun 2010 09:45:22 +0100

Hi Pierre-Jean,

> With your help, Ralf, and the last command line you've given, I've
> discovered that my problem came from .lf request added by preconv:
>   * My bashrc was containing GROFF_ENCODING="UTF-8"
>   * I thought that commenting this line and sourcing
>       bashrc would remove it, but not...

No, environment variables remain set in the current process until
removed, e.g.

    $ FOO=bar; export FOO
    $ env | grep FOO
    FOO=bar
    $ unset FOO
    $ env | grep FOO
    $ 

> Fortunately things are working better now,

Good!  But this appears to be a bug in groff with the introduction of
preconv.  Consider

    $ printf 'foo\n\n' |
    > preconv |
    > strace -fe trace=read nroff <(printf 'a\n.rd\nb\n') 2> >(grep 'read(0,') |
    > grep .
    a b
    [pid  4344] read(0,  <unfinished ...>
    [pid  4343] read(0, ".lf 1 /dev/fd/63\na\n.rd\nb\n", 4096) = 25
    [pid  4343] read(0, "", 4096)           = 0
    [pid  4343] read(0, "", 4096)           = 0
    $ 

I think the original file descriptor 0 is closed, the pipe from preconv
is dup(2)'d onto it, the preconv'd output of groff's input is read, EOF
is reached, and then the later processing of .rd correctly attempts to
read from FD 0 only to again see EOF.

> Is it possible to pass the preconv "-r" option to groff?

Not that I'm aware.  Anyone?

Cheers,
Ralph.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]