bug-groff
[Top][All Lists]
Advanced

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

[bug #55334] preconv fails when build with libuchardet on MS-Windows


From: Eli Zaretskii
Subject: [bug #55334] preconv fails when build with libuchardet on MS-Windows
Date: Sun, 30 Dec 2018 10:44:27 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0

URL:
  <https://savannah.gnu.org/bugs/?55334>

                 Summary: preconv fails when build with libuchardet on
MS-Windows
                 Project: GNU troff
            Submitted by: eliz
            Submitted on: Sun 30 Dec 2018 05:44:25 PM IST
                Category: Preprocessor preconv
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

If preconv is built with libuchardet, it produces partial output, "swallowing"
the initial portion of its input.

The reason for that is that the function detect_file_encoding calls 'fstat'
and 'fseek' on the input stream, and those are non-portable when the input
stream is not a file, but a pipe or a console device.  On MS-Windows, 'fstat'
reports a small value (the size of the pipe buffer), and 'fseek' simply fails.
 So the initial portion of the inout, read by detect_file_encoding, never
shows in the output.

The solution I propose is to copy stdin to a temporary file, and read from
that file instead.  The proposed patch is in the attachment.  The changes are
currently for MS-Windows only, but maybe other platforms will need them as
well.




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 30 Dec 2018 05:44:25 PM IST  Name: preconv_decode.dif  Size: 2KiB  
By: eliz

<http://savannah.gnu.org/bugs/download.php?file_id=45792>

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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