ini-parser
ini-parser copied to clipboard
Bug: AssignmentSpacer does not affect FileIniParser.WriteFile
The Configuration.AssignmentSpacer can be set. However, it is ignored when writing to a file. Instead, space is always used.
Had the same issue, seems to work if you apply the configuration to the data instead:
IniData data = new IniData(); data.Configuration.AssigmentSpacer = "";
Can you share your code? I am unable to reproduce this. This is the code I tested with
FileIniDataParser INIParser = new FileIniDataParser(new IniDataParser(new IniParserConfiguration() { AssigmentSpacer = " " }));
var iniData = INIParser.ReadFile(inputFilePath);
INIParser.WriteFile(outputFilePath, iniData);
I was able to reproduce it.
var data = new IniData(); data["main"]["test"] = "1"; var config = new IniParserConfiguration {AssigmentSpacer = ""}; var parser = new IniDataParser(config); var fileParser = new FileIniDataParser(parser); fileParser.WriteFile(Path.Combine(path, name + ".ini"), data);
setting in on the IniData configuration fixed it.