fix: file write for the '--inplace' option
removes tails for --inplace in case the source file is larger than the modified one
This commit is contained in:
parent
0ea49ff1ad
commit
a89e63f19f
@ -114,7 +114,7 @@ func iniWriteInplace(filename string, ini *types.Ini) error {
|
||||
}
|
||||
mode = info.Mode()
|
||||
}
|
||||
targetFile, err := os.OpenFile(realfilename, os.O_WRONLY|os.O_CREATE, mode)
|
||||
targetFile, err := os.OpenFile(realfilename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode)
|
||||
if err == nil {
|
||||
datawriter := bufio.NewWriter(targetFile)
|
||||
_, err = datawriter.WriteString(ini.Full())
|
||||
|
Loading…
x
Reference in New Issue
Block a user