Fix newline standardization.

See #377 for more specific details. This implements the same fix, but without requiring a temporary string (which, as unlikely as it may be, can possibly goof things up). It's also up-to-date instead of being a year behind the core. :)

Signed-off-by: Eric Roberts <eric@cryode.com>