This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch proposal for PR 19678

FranÃois-Xavier Coudert wrote:
Doesn't this patch mean that DOS line breaks ('\n\r') will be interpreted as
two separators?

No, since DOS line breaks are "\r\n". All matching that was done with '\n' is now done with '\n' or '\r', while all "eating" still only looks for '\n'. In current form, it works only because DOS line breaks are "\r\n" and not "\n\r".

WatCom recognizes that the LINEFEED (\n or <LF>) can also be a FORMFEED (\f or <FF>). They output <FF> when that is indicated by the carriage control. Some DOS text editors also understand this issue. I have not had anyone cite a "standard" more definitive than "everyone does it" for the use of <CR><LF> as the line separator when it is clearly not the case. Given the mechanical history it would seem that <LF><CR> would be equally valid but doing the <CR> first is clearly a more sensible choice for mechanical device with a type head. The Unix convention followed from the observation that many devices had an option to always treat a <LF> as a <CR><LF> which was a convenience when lines were slow and disks small. Apple chose <CR> for much the same reason. One might believe that <CR> is a bit closer to the intended usage that <LF>. There have been systems that do the ASCII correctly and used <RS> (Record Separator) as one would expect from the definition of the ASCII control characters. ModComp is such an example.

Just a heads up that DOS is a bit nastier than just <CR><LF> and that
WatCom handled the problem well.

    PR libfortran/19678
    * list_read.c: Add support for DOS files

This level of detail is insufficient. See
<> and
<> for a detailed description of what
a ChangeLog should look like. Basically, you must list all changed functions,
and the changes therein.

What about:

2005-02-24 FranÃois-Xavier Coudert <>

PR libfortran/19678
* list_read.c: Add support for DOS files, adding '\r' in the list of possible separators (is_separator and CASE_SEPARATORS). Many tests for "c == '\n'" changed to "(c == '\n' || c == '\r')" (in next_char, eat_separator, finish_separator, read_real and namelist_read).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]