When Stephen Rasku answered, I thought "Gee, there are some sensible
people on this list after all." :-) Then Larry answered again...
> > This allows the same source to be compiled from the same location for
> > multiple platforms.
>
> Only because either your Windows or Unix compilers are willing to
> compile defective text files. (I'm guessing that it's the Windows
> compiler since it's fairly natural to ignore missing <CR>s, it's not
> nearly as natural to ignore extra ones. In fact, I wouldn't be
> surprised if the Solaris compilers refused to compile DOS-format files.)
Actually, there are only some programs that care about line endings.
And, apparently, a few over-zealous C programmers :-) Most compilers
don't care. And most well-written runtimes don't make the programmer
care, either. Java's implementation of its readLine() method accepts
any of \r, \n, or \r\n, while also correctly handling Unicode characters
and translations from local encodings to/from Unicode on the fly. If
you're interested (you're probably not, given how strongly you've already
stated your position, but just in case, and others may be), there are
at least two GPL'd implementations (Kaffe and Japhar) that you could
look at.
> If you want to depend on that, that's fine, just don't try to check the
> files out on one platforms and then check them in on a different one.
> It's simply not feasible to expect CVS to know intimate details of file
> formats on all the different platforms it might be expected to work on
> -- the best it can do is to count on the C library to know the details
> of the specific platform it's running on.
Well, actually it is, as I've already said. At least on any platform
that allows text files. This covers M$Win, UNIX, OS2, MacOS, and durn
near everything else.
While I'm at it, I am sort of able to handle ^M's in the text files
that are in my repository (ie., my files, as opposed to files in CVS)
by using this in my CVSROOT/wrappers:
# Actions taken on each checkin.
# Strip out ^M from text files (need to elaborate if using MacCVS)
#
*.c -t 'tr -d "
"'
*.HTM -t 'tr -d "
"'
*.htm -t 'tr -d "
"'
*.html -t 'tr -d "
"'
*.iwz -t 'tr -d "
"'
*.java -t 'tr -d "
"'
Makefile -t 'tr -d "
"'
*.txt -t 'tr -d "
"'
and so on. It seems to work sporadically, but that doesn't seem to
bother anything.
Thanks
Ian Darwin
[EMAIL PROTECTED]