[Issue 1349] ^M pollution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 23 17:03:50 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1349


felipe.contreras at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




------- Comment #6 from felipe.contreras at gmail.com  2007-07-23 19:03 -------
(In reply to comment #3)
> Modern text processing software should accept the following as line
> terminations:
> 
> LF (unix)
> CR (mac)
> CRLF (windows, DEC)
> 
> It isn't just a unix world. gnumake used to fail on CR's a few years ago, that
> got fixed. gcc works on those line endings, so does all Digital Mars software.
> If you are using software that doesn't recognize common line terminations, that
> is a bug in that software, not the text file. Since D source code is portable
> between operating systems, it cannot be required to use just one protocol.
> 
> If you need an editor that works properly, see microEmacs (downloadable from
> digitalmars.com).
> 

I'm using vim aka. "an editor that works properly".

This isn't a UNIX world, but most serious development at the level that D is
aiming is done in UNIX. So it's funny that you have DOS line endings, while as
you say: modern text processing software should accept all the line endings.

Professional text editors should not mix line endings. Whatever text editor
introduced those glitches it surely runs on Windows, and the whole thing simply
looks bad.

Forgetting about the UNIX vs Windows stuff there are advantages of just LF:
* Less space
* Easier processing

For example:
 perl -spi -e 's/\r//' $file

That would solve all the issues (transform to LF). I would love to see how
"easy" it would be the line to transform everything to CRLF.

BTW, these are the files that are wrong:
./phobos/internal/arraycat.d
./phobos/internal/gc/gc.d
./phobos/internal/critical.c
./phobos/std/math.d
./phobos/std/socket.d
./phobos/std/format.d
./dmd/constfold.c
./dmd/template.c
./dmd/html.c

I found them with:
 grep -P '\r[^\n]' -l -r .

This is on the GDC official tarball.


-- 



More information about the Digitalmars-d-bugs mailing list