forked from ndevilla/iniparser
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] master from ndevilla:master #9
Open
pull
wants to merge
59
commits into
ansi88:master
Choose a base branch
from
ndevilla:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit fa33d28.
…into zrrto-test_find_entry # Conflicts: # test/test_iniparser.c
…into zrrto-add_null_check # Conflicts: # src/dictionary.c
… all allocated resources and return NULL
Support for loading string/custom streams
The section "12345]" is readable from dictionary directly after iniparser_set(). The section is also written to file by iniparser_dump_ini() as "[12345]]" But if the file is parsed by iniparser_load() it is read as "12345". The reason is that iniparser_load() considers a section name to be enclosed by "[" and "]". If it find a line enclosed by square brackets it takes the characters enclosed by and excluding those brackets. refs #147
This commit will fix an inconsistency in the behavior of `iniparser_set()` and `iniparser_load()`. It will also make sure that dumping working dictionary results in an INI file which provides the same dictionary after loading this INI. The inconsistency is: - `iniparser_set()` supports escaped quotes, semicolon and hash in values: ``` "str\"ing" => str"ing "str;ing" => str;ing "str#ing" => str#ing ``` -`iniparser_load()` does not support semicolon and hash in unquoted values: ``` str;ing => str str#ing => str ``` Which is correct, because in this case semicolon and hash indicate that the rest of the line is a comment. - `iniparser_load()` supports quotes in unquoted values ``` str"ing => str"ing ``` - `iniparser_load()` supports semicolon and hash in quoted values: ``` "str;ing" => str;ing "str#ing" => str#ing ``` However, before this commit: - `iniparser_load()` did not support escaped quotes in quoted values: ``` "str\"ing" => str\ ``` And: - `iniparser_dump_ini()` wrote all values without quotes The implemented fix is: - `iniparser_load()` supports escaping iff the value is quoted - `iniparser_dump_ini()` will quote all values and escape '\' and '"' These changes do not break existing test cases. refs #97
Quote and escape
Sections with brackets
..., declared with attribute warn_unused_result [-Wunused-result]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )