~sircmpwn/himitsu-devel

himitsu: himitsud: query: close prompter if decrypt but no matches v1 NEEDS REVISION

Pinghao Wu: 1
 himitsud: query: close prompter if decrypt but no matches

 1 files changed, 5 insertions(+), 2 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/42111/mbox | git am -3
Learn more about email & git

[PATCH himitsu] himitsud: query: close prompter if decrypt but no matches Export this patch

---
 cmd/himitsud/cmd.ha | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cmd/himitsud/cmd.ha b/cmd/himitsud/cmd.ha
index ce17c7d..5aa5232 100644
--- a/cmd/himitsud/cmd.ha
+++ b/cmd/himitsud/cmd.ha
@@ -190,10 +190,11 @@ fn exec_query(serv: *server, client: *client, args: []str) (void | cmderror) = {
			writefmt(client, "error Failed to unlock");
			return;
		};
		if (!decrypt) {
		if (decrypt) {
			prompter = new;
		} else {
			prompt::close(&new)?;
		};
		prompter = new;
	};

	const q = query::parse_items(cmd.args)?;
@@ -236,6 +237,8 @@ fn exec_query(serv: *server, client: *client, args: []str) (void | cmderror) = {
			writefmt(client, "error User declined");
			return;
		};
	} else if (prompter is prompt::prompter) {
		prompt::close(&(prompter: prompt::prompter))?;
	};

	let buf = bufio::dynamic(io::mode::WRITE);
-- 
2.41.0