Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
INI: Only consider empty keys for INI sections
Browse files Browse the repository at this point in the history
This commit closes #1697.
  • Loading branch information
sanssecours committed Jan 24, 2018
1 parent e5ca864 commit 808a53f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
21 changes: 0 additions & 21 deletions src/plugins/ini/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,27 +140,6 @@ kdb rm -r user/examples/ini
sudo kdb umount user/examples/ini
```

## Directory Values

By default the INI plugin does not store values in a directory key, if you create a leaf node below the directory key first.

```sh
sudo kdb mount config.ini /examples/ini ini

kdb set /examples/ini/aimee/man 'Deathly'
kdb file /examples/ini | xargs cat
#> [aimee]
#> man = Deathly
kdb set /examples/ini/aimee 'Save Me'
kdb get /examples/ini/aimee/man
#> Deathly
kdb get /examples/ini/aimee # 😭
#>

kdb rm -r /examples/ini
sudo kdb umount /examples/ini
```

## Binary Data

By default the INI plugin does not support binary data. You can use the [Base64 plugin](../base64/) to remove this limitation.
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/ini/ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,7 @@ static int iniWriteKeySet (FILE * fh, Key * parentKey, KeySet * returned, IniPlu
}
else
{
if (isSectionKey (cur))
if (isSectionKey (cur) && keyGetValueSize (cur) <= 1)
{
if (keyIsBelow (parentKey, cur))
{
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/mathcheck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Full example:
```sh
# Backup-and-Restore:/examples/mathcheck

sudo kdb mount mathcheck.dump /examples/mathcheck dump mathcheck
sudo kdb mount mathcheck.dump /examples/mathcheck mathcheck

kdb set /examples/mathcheck/a 3.1
kdb set /examples/mathcheck/b 4.5
Expand Down

0 comments on commit 808a53f

Please sign in to comment.