Merge pull request #5819 from cdunn2001/fix-5816

Use writeable file in parsecfg.writeConfig()
This commit is contained in:
Dominik Picheta
2017-05-16 13:48:49 +01:00
committed by GitHub

View File

@@ -540,7 +540,8 @@ proc writeConfig*(dict: Config, filename: string) =
## Writes the contents of the table to the specified configuration file.
## Note: Comment statement will be ignored.
let file = open(filename, fmWrite)
let fileStream = newFileStream(filename)
defer: file.close()
let fileStream = newFileStream(file)
defer: fileStream.close()
dict.writeConfig(fileStream)