Support almost arbitrary characters in dir names #101
Merged
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.
dconf itself places minimal restrictions on key paths.
dconf_is_key
anddconf_is_dir
just stipulate the following:/
.//
./
./
.So in theory, they can all contain special characters like
[]*#@
. In practice,dconf dump
will fail to print paths containing[
or]
due to limitations ofGKeyFile
enforced byg_key_file_is_group_name
so those or control characters will not really appear in input of dconf2nix. But it can still contain all other kinds of characters including spaces at the start or end.Since the spaces are now preserved as expected, we need to remove them from the test cases (not sure how they got there). Also clean up the duplicate dirs/groups.
Keys have slightly tighter restrictions introduced by
g_key_file_is_key_name
. Whitespace is only allowed in the middle of a key and=
is not allowed at all.[
and]
are not allowed either, except at the end in a subkey suffix, which has further restrictions. But I doubt anyone will want special characters in keys so I am only extending it with an underscore.