-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for escaped quotes, semicolon and hash in quoted values
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
- Loading branch information
1 parent
068b66a
commit 8854c48
Showing
3 changed files
with
136 additions
and
18 deletions.
There are no files selected for viewing
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 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 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