URL:
  <http://gna.org/patch/?2843>

                 Summary: Make secfile reading cope with \r\n and \n\r line
endings on all platforms
                 Project: Freeciv
            Submitted by: jtn
            Submitted on: Fri Jul 29 00:30:49 2011
                Category: general
                Priority: 5 - Normal
                  Status: Ready For Test
                 Privacy: Public
             Assigned to: jtn
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 

    _______________________________________________________

Details:

Following on from bug #18396:

Attached patch makes secfile reading treat \r\n and \n\r line endings the
same as \n, if it sees them (e.g., if opening a file with DOS/Windows line
endings on Unix).

Tested on Unix. I haven't checked what happens with a Windows build of
Freeciv opening a Unix file in text mode; it depends if fgets() treats the
lone \n as a line ending.

(I briefly wondered if there might be crazy-but-theoretically-supported
multibyte character encodings where 0x0D might be a valid thing to see at the
start or end of a line. But any such encoding was pretty much doomed anyway if
opened in text mode. Certainly UTF-8 doesn't fall into this category.)

This probably wants some testing...



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri Jul 29 00:30:49 2011  Name: trunk-S2_3-secfile-crlf.diff  Size: 1kB
  By: jtn

<http://gna.org/patch/download.php?file_id=13688>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?2843>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to