bugGNU roff - Bugs: bug #55335, preconv produces CR CR LF...

 
 

bug #55335: preconv produces CR CR LF end-of-line on MS Windows

Submitter:  Eli Zaretskii <eliz>
Submitted:  Sun 30 Dec 2018 03:49:50 PM UTC
   
 
Category:  Preprocessor preconv Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Invalid
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 31 Mar 2023 10:17:31 AM UTC, comment #6: 

Thanks to the anonymous clarifier for the the clarification. 

Extrapolating from comment #5, input files with CR-LF line endings (on any platform) should be converted to use LF (only) line endings before processing with any GNU roff programs.

In the forthcoming groff 1.23.0, the groff_man_style(7) man page also says the following.

>    Man pages should be encoded using Unicode basic Latin code points
>    exclusively, and employ the Unix lineā€ending convention (U+000A
>    only).


Resolving as invalid.

Dropping patch annotation from invalid ticket.

Also, as noted in bug #55299, Achim Gratz is maintaining groff for Cygwin now, not Brian Inglis.  Thanks for the correction.

G. Branden Robinson <gbranden>
Group administrator
Fri 31 Mar 2023 03:59:49 AM UTC, comment #5: 

Cygwin opted for POSIX/Linux/etc. compatibility a few years ago in 2017, and dropped all text mode open patches to utilities including coreutils, gawk, grep, sed, etc. causing some consternation, and much rejoicing amongst those who use it and newlib for embedded and Unix development, because Windows is what the org gives them.

We advise those who wish Windows compatibility including CR-LF to use utility commands, unix2dos, Msys2 or Mingw64, both somewhat based on Cygwin and its Windows cross build tools and libraries, native Windows apps.

Anonymous
Thu 30 Mar 2023 11:08:17 PM UTC, comment #4: 

Adding CC of Brian Inglis, who now takes care of groff for Cygwin.

Brian, can you comment on this issue?

G. Branden Robinson <gbranden>
Group administrator
Thu 22 Oct 2020 05:24:20 PM UTC, comment #3: 

I don't see a risk here.  If i read src/include/nonposix.h correctly, SET_BINARY() is a NOOP on any sane system.  So given that Eli tested it extensively on Windows, i think no further testing is needed.  Any developer who understands in principle what SET_BINARY() is supposed to do (i.e., not me) and who thinks the patch looks good to code inspection should just push it.

Ingo Schwarze <schwarze>
Group Member
Wed 21 Oct 2020 02:20:24 PM UTC, comment #2: 

You mean, someone other than myself?

Eli Zaretskii <eliz>
Wed 21 Oct 2020 07:26:10 AM UTC, comment #1: 

Do we have someone with access to a Windows machine to test this on?

Eli filed it almost immediately after the previous release; it'd be nice to do something about it before the next one.

G. Branden Robinson <gbranden>
Group administrator
Sun 30 Dec 2018 03:49:50 PM UTC, original submission:  

When compiled for MS-Windows, preconv reads its input in binary mode, thus leaving the CR characters of the CR LF end-of-line marker unconverted to the Unix LF-only format.  However, the output is written in the default text mode, which adds another CR before LF, thus producing files with an extra CR.  This causes pic (and possibly other preprocessors) to complain about "invalid input character code 13".

The solution is to switch stdout to binary mode when needed.  The proposed patch is in the attachment.

Eli Zaretskii <eliz>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #45793:  preconv_binary.dif added by eliz (613B - application/vnd.ms-excel)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (new groff maintainer for cygwin)
  • -email is unavailable- added by schwarze (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by eliz (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-31 gbranden StatusNeed Info Invalid
        Assigned toNone gbranden
        Open/ClosedOpen Closed
        Summary[PATCH] preconv produces CR CR LF end-of-line on MS-Windows preconv produces CR CR LF end-of-line on MS Windows
    2023-03-30 gbranden Carbon-Copy- Added -email is unavailable-
    2020-10-21 gbranden StatusNone Need Info
    2020-10-13 barx Carbon-CopyRemoved 93119 -
    2020-10-13 barx Summarypreconv produces CR CR LF end-of-line on MS-Windows [PATCH] preconv produces CR CR LF end-of-line on MS-Windows
    2018-12-30 eliz Attached File- Added preconv_binary.dif, #45793

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code