~sircmpwn/himitsu-devel

himitsu: himitsu::query: allow '[' and ']' in keys v1 PROPOSED

Alexey Yerin: 1
 himitsu::query: allow '[' and ']' in keys

 1 files changed, 2 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/himitsu-devel/patches/33040/mbox | git am -3
Learn more about email & git

[PATCH himitsu] himitsu::query: allow '[' and ']' in keys Export this patch

---
It looks kind of ugly, but works

 himitsu/query/parse.ha | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/himitsu/query/parse.ha b/himitsu/query/parse.ha
index 12ef57f..a936042 100644
--- a/himitsu/query/parse.ha
+++ b/himitsu/query/parse.ha
@@ -9,7 +9,8 @@ use fmt;
let keyre: regex::regex = regex::regex { ... };

@init fn init() void = {
	keyre = regex::compile(`^[-_A-Za-z]+$`)!;
	// Yes, this is a valid POSIX regular expression
	keyre = regex::compile(`^[]A-Za-z-_[]+$`)!;
};

@fini fn fini() void = {
-- 
2.36.1
I would prefer to actually fix this by allowing arbitrary shell-quoted
strings in keys.