Hi,
An example INI file contains a row:
[section]
key="name" <email-address@domain>
I get name when I read the value of the key "key" with
GetString(string, string) method. The
GetPrivateProfileString function of Windows API returns
full line with quotes and other special characters,
ie. "name" <email-address@domain>.
I consider this behavior as a bug.
I call GetString after I have merged three sources (two
INI-files plus command line arguments). I haven't tested
wether this function works as expected without merge.
A short introduction to the problem:
Dim iniSource1 As Nini.Config.IniConfigSource
Dim iniSource2 As Nini.Config.IniConfigSource
Dim cliSource As Nini.Config.ArgvConfigSource
iniSource1 = New Nini.Config.IniConfigSource
(some_path_1)
' adding aliases here
iniSource2 = New Nini.Config.IniConfigSource
(some_path_2)
' adding aliases here
cliSource = New Nini.Config.ArgvConfigSource
(cliArgumentsArray)
' adding switches here
iniSource1.Merge(iniSource2)
iniSource1.Merge(cliSource)
' this line shows name, NOT "name" <email-
address@domain> as it should
Console.WriteLine(iniSource1.Configs
("section").GetString("key", default_recipient_spec))
Best Regards,
Olli-Pekka Isola
olli-pekka dot isola at luukku dot com
Logged In: YES
user_id=163900
I studied your problem and came to the conclusion that you
are right. The behavior with quotes was added because of
the Samba-style files. I will turn off this behavior by
default. Thanks very much for your contribution.
Logged In: YES
user_id=894033
Thanks for your quick response! I will monitor Nini project for
the next publicly available release.
Logged In: YES
user_id=163900
A fix for this bug has been checked into CVS.