Skip to content

Commit

Permalink
fixes #15 - Incorrect result of SetValue method
Browse files Browse the repository at this point in the history
  • Loading branch information
salaros committed Dec 19, 2019
1 parent ca6969a commit 026edaa
Show file tree
Hide file tree
Showing 3 changed files with 772 additions and 751 deletions.
16 changes: 6 additions & 10 deletions src/ConfigParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -577,19 +577,15 @@ public bool Save(string configFilePath = null)

try
{
using (var fileWriter = new FileStream(fileInfo.FullName, FileMode.OpenOrCreate, FileAccess.Write))
using (var fileWriter = new FileStream(fileInfo.FullName, FileMode.Create, FileAccess.Write))
{
using (var writer = new StreamWriter(
fileWriter,
Settings.Encoding ?? new UTF8Encoding(false, false),
4096
#if !NET40
, true
#endif
)
)
fileWriter,
Settings.Encoding ?? new UTF8Encoding(false, false)
))
{
writer.Write(ToString());
var fileContent = ToString();
writer.Write(fileContent);
}
}
return true;
Expand Down
Loading

0 comments on commit 026edaa

Please sign in to comment.