summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/readline.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/lib/readline.c b/source3/lib/readline.c
index 254f55c86a..fd57799b57 100644
--- a/source3/lib/readline.c
+++ b/source3/lib/readline.c
@@ -45,6 +45,16 @@
# define RL_COMPLETION_CAST
#endif /* HAVE_NEW_LIBREADLINE */
+static bool smb_rl_done;
+
+void smb_readline_done(void)
+{
+ smb_rl_done = true;
+#if HAVE_LIBREADLINE
+ rl_done = 1;
+#endif
+}
+
/****************************************************************************
Display the prompt and wait for input. Call callback() regularly
****************************************************************************/
@@ -69,7 +79,7 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
return NULL;
}
- while (1) {
+ while (!smb_rl_done) {
timeout.tv_sec = 5;
timeout.tv_usec = 0;
@@ -87,6 +97,7 @@ static char *smb_readline_replacement(const char *prompt, void (*callback)(void)
callback();
}
}
+ return NULL;
}
/****************************************************************************