bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: sed for non-DOS files


From: Hans-Bernhard Broeker
Subject: Re: sed for non-DOS files
Date: 5 Feb 2002 14:15:24 GMT

Roger Spellman <address@hidden> wrote:

> Yes, but it would be nice to have an option to sed that turns off
> this feature.  For example, in a C program with a multi-line macro,
> the last character of the line must be a backslash.  GCC seems to
> like UNIX style files, because GCC gives an error if the backslash
> is followed by a Ctrl-M.

In that case, the bug is clearly in GCC.  C sources are text files,
and thus GCC should read them in a way that makes sure
platform-defined line endings are treated correctly.  A sane port of
GCC (such as the one to DOS, part of the DJGPP project) has to take
that into account.

A typical root of such problems is actually Cygwin.  Not their GCC
port, but their runtime library and its idea of a "binary mount" to
avoid having to patch Unix programs that don't have the "b" qualifier
in their fopen() calls whenever the file is a binary one.  Trying to
fix a problem of broken programs, this trick actually breaks perfectly
correct ones.
-- 
Hans-Bernhard Broeker (address@hidden)
Even if all the snow were burnt, ashes would remain.



reply via email to

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