diff --git a/client/agent.c b/client/agent.c
index 31bbdd5..5183238 100644
--- a/client/agent.c
+++ b/client/agent.c
if (!pending_message)
return FALSE;
+ if (!strcmp(input, "yes"))
+ g_dbus_send_reply(conn, pending_message, DBUS_TYPE_INVALID);
+ else if (!strcmp(input, "no"))
+ g_dbus_send_error(conn, pending_message,
+ "org.bluez.Error.Rejected", NULL);
+ else
+ g_dbus_send_error(conn, pending_message,
+ "org.bluez.Error.Canceled", NULL);
+
g_dbus_send_reply(conn, pending_message, DBUS_TYPE_INVALID);
dbus_message_unref(pending_message);
diff --git a/client/main.c b/client/main.c
index 0213bf0..d537582 100644
--- a/client/main.c
+++ b/client/main.c
char *cmd, *arg;
int i;
- if (agent_input(dbus_conn, input) == TRUE)
- goto done;
-
if (!input) {
rl_insert_text("quit");
rl_redisplay();
if (!strlen(input))
goto done;
+ if (agent_input(dbus_conn, input) == TRUE)
+ goto done;
+
add_history(input);
cmd = strtok_r(input, " ", &arg);