Detect line endings