On (02/01/15 14:47), Dmitri Pal wrote:
Please find attached patches for the new interface to modify configuration
files using libini_config.
I was writing additional unit tests for missing parts
and I found a small problem with INI_VA_MOD and INI_VA_MODADD
The documentation says:
* @brief Update a specific value (best effort).
* Value of the index is used to determine which one of the duplicates
* needs to be updated. Index is 0-based. If the index is out of range
* the function will do best effort and return the last instance of the key.
* For example if you have five duplicates and you are searching for the tenth
* the function will find and return the fifth instance.
INI_VA_MOD = 1,
key0 = valuer0
key1 = value1a
key1 = value1b
key1 = value1c
key1 = value1d
key2 = value2
key3 = value3
key0 = valuer0 key0 = valuer0
key1 = value1a key1 = value1a
key1 = value1b key1 = value1b
key1 = value1c key1 = value1c
key1 = newvalue <<<<<<<<<< key1 = value1d
key2 = value2 <<<<<<<<<< key2 = newvalue
key3 = value3 key3 = value3
I need the second pair of eyes to look into this issue.
I will appreciate if you could find few minutes.
Attached is updated patches with check-based unit for this problem.
BTW. It's not clear to me waht is a difference
between INI_VA_MOD and INI_VA_MODADD
or between INI_VA_MOD_E and INI_VA_MODADD_E.
The code is the same.