Archive: WriteINIStr removes INI entries


WriteINIStr removes INI entries
When I perform this call with an empty entry it removes the INI entry from the file.

my.ini:
[section]
my_item=""
another_item="abc"

WriteINIStr $INSTDIR\my.ini section my_item ""

Now my.ini looks like this:

[section]
another_item="abc"

This is a very unwanted behavior. Is this a bug?

Brent


This might be a bug, but it is easily overcome: replace the empty string "" by " " (a space). Now the entry doesn't get deleted!

-Hendri.


I believe this is happening because of the way the windows API call to add the ini entry works. I don't think this is a problem of NSIS's doing.


Originally posted by rainwater
I believe this is happening because of the way the windows API call to add the ini entry works. I don't think this is a problem of NSIS's doing.
[edit]
That's right.

The Win32 API deletes the entry when a null string is given as value.