Use writeable file in parsecfg.writeConfig()

Fixes #5816
This commit is contained in:
Christopher Dunn 2017-05-15 09:52:57 -05:00
commit 117c983d13

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)