1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Merge from HEAD - don't mix FILE and X_FILE - fixes debian bug

http://bugs.debian.org/178219 where the first 4096 bytes where being chewed
into the FILE buffer, and never available to X_FILE's read.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 0001-01-01 00:00:00 +00:00
parent b54f6bf06c
commit 8af72c1384

View File

@ -56,7 +56,7 @@ static char *smb_readline_replacement(char *prompt, void (*callback)(void),
fd_set fds; fd_set fds;
static pstring line; static pstring line;
struct timeval timeout; struct timeval timeout;
int fd = fileno(stdin); int fd = x_fileno(x_stdin);
char *ret; char *ret;
x_fprintf(dbf, "%s", prompt); x_fprintf(dbf, "%s", prompt);
@ -70,7 +70,7 @@ static char *smb_readline_replacement(char *prompt, void (*callback)(void),
FD_SET(fd,&fds); FD_SET(fd,&fds);
if (sys_select_intr(fd+1,&fds,NULL,NULL,&timeout) == 1) { if (sys_select_intr(fd+1,&fds,NULL,NULL,&timeout) == 1) {
ret = fgets(line, sizeof(line), stdin); ret = x_fgets(line, sizeof(line), x_stdin);
return ret; return ret;
} }
if (callback) if (callback)
@ -86,7 +86,7 @@ char *smb_readline(char *prompt, void (*callback)(void),
char **(completion_fn)(char *text, int start, int end)) char **(completion_fn)(char *text, int start, int end))
{ {
#if HAVE_LIBREADLINE #if HAVE_LIBREADLINE
if (isatty(fileno(stdin))) { if (isatty(fileno(x_stdin))) {
char *ret; char *ret;
/* Aargh! Readline does bizzare things with the terminal width /* Aargh! Readline does bizzare things with the terminal width