TeX relies on a “change file” for system dependent adjustments. One of these adjustments is making TeX aware of what method the operating system uses for marking the end of a record (a line in a text file, speaking less formally).
Different operating systems had very different ideas about this: it could be
- CR+LF (for instance, MS-DOS)
- CR (for instance, Mac OS before version 10)
- LF (for instance, Unix)
- nothing, for systems that used fixed length records
In the first implementations of TeX, this was taken literally; for instance OzTeX used CR as record terminator and files coming from DOS systems without conversion could be compiled wrongly, because some DOS editors used LF+CR as record terminator.
In order to enhance portability between different file systems, the developers of Web2C decided to be “record terminator agnostic”. When a file is opened by TeX, its first lines are examined and the record terminator used is determined; then it's changed into LF and passed to TeX for further processing.
If you do
perl -e 'print "\\obeylines a\rb\r\\input zzz \\bye"' > xyz.tex
perl -e 'print "\\obeylines c\nd\\bye"' > zzz.tex
the output of
pdftex xyz would be
but also the output of
pdftex '\catcode`^^L=12 \input xyz' wouldn't be different
^^L would be interpreted as outer
\par; by setting its catcode to 12 we tell it's printable, but nothing appears even if
\n is used as record terminator in
So one doesn't have to know what operating system a file comes from: inputting it will do “the right thing”.
Any Web2C based TeX distribution will thus behave the same when fed the same file.
What source file does this? I don't know, but I'm not going to read the complete sources.