iniparser icon indicating copy to clipboard operation
iniparser copied to clipboard

value following quoted string are skipped

Open touilleMan opened this issue 9 years ago • 3 comments

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

touilleMan avatar Apr 08 '16 19:04 touilleMan

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.

dobragab avatar Apr 09 '16 00:04 dobragab

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

touilleMan avatar Apr 09 '16 09:04 touilleMan

@dobragab wrote

I checked Winapi: GetPrivateProfileString ends up with "hello" world, and I think that is the desired value.

So iniparser's behavior is not consistent to Winapi.

key = "hello" returns hello, 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.

lmoellendorf avatar Mar 18 '24 22:03 lmoellendorf