static bool smb_rl_done;
-#if HAVE_LIBREADLINE
+#ifdef HAVE_LIBREADLINE
/*
* MacOS/X does not have rl_done in readline.h, but
* readline.so has it
void smb_readline_done(void)
{
smb_rl_done = true;
-#if HAVE_LIBREADLINE
+#ifdef HAVE_LIBREADLINE
rl_done = 1;
#endif
}
char **(completion_fn)(const char *text, int start, int end))
{
char *line = NULL;
- int fd = x_fileno(x_stdin);
+ int fd = fileno(stdin);
char *ret;
/* Prompt might be NULL in non-interactive mode. */
if (prompt) {
- x_fprintf(x_stdout, "%s", prompt);
- x_fflush(x_stdout);
+ printf("%s", prompt);
+ fflush(stdout);
}
line = (char *)malloc(BUFSIZ);
pfd.events = POLLIN|POLLHUP;
if (sys_poll_intr(&pfd, 1, 5000) == 1) {
- ret = x_fgets(line, BUFSIZ, x_stdin);
+ ret = fgets(line, BUFSIZ, stdin);
if (ret == 0) {
SAFE_FREE(line);
}
char *ret;
bool interactive;
- interactive = isatty(x_fileno(x_stdin)) || getenv("CLI_FORCE_INTERACTIVE");
+ interactive = isatty(fileno(stdin)) || getenv("CLI_FORCE_INTERACTIVE");
if (!interactive) {
return smb_readline_replacement(NULL, callback, completion_fn);
}
-#if HAVE_LIBREADLINE
+#ifdef HAVE_LIBREADLINE
- /* Aargh! Readline does bizzare things with the terminal width
+ /* Aargh! Readline does bizarre things with the terminal width
that mucks up expect(1). Set CLI_NO_READLINE in the environment
to force readline not to be used. */
rl_basic_word_break_characters = " \t\n";
}
-#if HAVE_DECL_RL_EVENT_HOOK
+#ifdef HAVE_DECL_RL_EVENT_HOOK
if (callback)
rl_event_hook = (rl_hook_func_t *)callback;
#endif