bug-groff
[Top][All Lists]
Advanced

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

[bug #62131] [preconv] should test for non-seekable stream input


From: G. Branden Robinson
Subject: [bug #62131] [preconv] should test for non-seekable stream input
Date: Thu, 3 Mar 2022 05:28:10 -0500 (EST)

Follow-up Comment #1, bug #62131 (project groff):

Here are some examples of debugging output with `preconv` from groff 1.22.4,
illustrating reads from three non-seekable streams: standard input, closed
standard input, and /dev/tty.

`preconv` has to be interrupted when reading from /dev/tty, since it is a
valid data source.


$ printf '' | preconv -d
default encoding: 'UTF-8'
standard input:
  no encoding tag
  len: 0
  could not detect encoding with uchardet
  encoding used: 'UTF-8'
.lf 1 -
$ preconv -d 0<&-
default encoding: 'UTF-8'
standard input:
  no encoding tag
fstat: Bad file descriptor
  could not detect encoding with uchardet
  encoding used: 'UTF-8'
.lf 1 -
$ preconv -d /dev/tty
default encoding: 'UTF-8'
file '/dev/tty':
^C


Here's the behavior with my pending change.


$ printf '' | ./build/preconv -d
default encoding: 'UTF-8'
processing '<standard input>'
  stream is unseekable: Illegal seek
  encoding used: 'UTF-8'
.lf 1 -
$ ./build/preconv -d 0<&-
default encoding: 'UTF-8'
processing '<standard input>'
  stream is unseekable: Bad file descriptor
  encoding used: 'UTF-8'
.lf 1 -
$ ./build/preconv -d /dev/tty
default encoding: 'UTF-8'
processing '/dev/tty'
  stream is unseekable: Illegal seek
^C


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62131>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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