shared/ask-password-api: return "error" when dialogue is cancelled
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Feb 2020 08:32:16 +0000 (09:32 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Feb 2020 09:51:13 +0000 (10:51 +0100)
commit72c08a471c9ccb65209b72ea539acefe17c33245
treebd11c6f85deaa725c1c0e73dbbfdd1626692b830
parent39e96f844a467400cda1dd24401b2c8fbe480eeb
shared/ask-password-api: return "error" when dialogue is cancelled

test-ask-password-api would crash if ^D was pressed.
If think the callers generally expect a non-empty strv as reply. Let's
return an error if we have nothing to return.

Also modernize test-ask-password-api a bit.
src/shared/ask-password-api.c
src/test/test-ask-password-api.c