From a71b2a2604bf23ae4044be33f1b371d56983c9af Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Thu, 19 Feb 2015 16:51:58 +0100 Subject: [PATCH] TextWriter without hardcoded line endings --- mcs/class/referencesource/mscorlib/system/io/textwriter.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mcs/class/referencesource/mscorlib/system/io/textwriter.cs b/mcs/class/referencesource/mscorlib/system/io/textwriter.cs index d3e22d49231..4f426e3ca94 100644 --- a/mcs/class/referencesource/mscorlib/system/io/textwriter.cs +++ b/mcs/class/referencesource/mscorlib/system/io/textwriter.cs @@ -96,6 +96,15 @@ namespace System.IO { // This should be initialized to Environment.NewLine, but // to avoid loading Environment unnecessarily so I've duplicated // the value here. +#if MONO + static string InitialNewLine { + get { + return Environment.NewLine; + } + } + + protected char[] CoreNewLine = InitialNewLine.ToCharArray (); +#else #if !PLATFORM_UNIX private const String InitialNewLine = "\r\n"; @@ -106,7 +115,7 @@ namespace System.IO { protected char[] CoreNewLine = new char[] {'\n'}; #endif // !PLATFORM_UNIX - +#endif // Can be null - if so, ask for the Thread's CurrentCulture every time. private IFormatProvider InternalFormatProvider; -- 2.11.4.GIT