iniparser
iniparser copied to clipboard
value following quoted string are skipped
Given the .ini
[main]
key = "hello" world
Iniparser will stop reading after the first double quoted string so we will end up with
key=hello instead of key=hello world
I'm not sure if it's a bug or an "undocumented feature" (a line should not contain more than a single quoted string) but in such case we should display a syntax error instead of just dropping information
I checked Winapi: GetPrivateProfileString ends up with "hello" world, and I think that is the desired value.
key = "hello" returns hello, I think it checks quotes only at first and last character. I believe the only library iniparser should be consistent to is Winapi.
So it's an "undocumented feature" then ;-)
I agree to keep it this way to be consistent to Winapi, but maybe we could add a word about this in doc/iniparser.main
@dobragab wrote
I checked Winapi:
GetPrivateProfileStringends up with"hello" world, and I think that is the desired value.
So iniparser's behavior is not consistent to Winapi.
key = "hello"returnshello, I think it checks quotes only at first and last character.
Interestingly Winapi removes quotes if they are first AND last character of value. But both quotes are kept if only one is first character.