From 68833d5d6a80cf9e88d5e335285ca381cd865c3e Mon Sep 17 00:00:00 2001 From: Brendan Cully Date: Sun, 7 Aug 2005 04:58:12 +0000 Subject: Make username prompts unbuffered like password prompts are (no more folder-hook push garbage) --- account.c | 2 +- curs_lib.c | 4 ++-- protos.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/account.c b/account.c index 13a02a71..99146629 100644 --- a/account.c +++ b/account.c @@ -153,7 +153,7 @@ int mutt_account_getuser (ACCOUNT* account) { snprintf (prompt, sizeof (prompt), _("Username at %s: "), account->host); strfcpy (account->user, NONULL (Username), sizeof (account->user)); - if (mutt_get_field (prompt, account->user, sizeof (account->user), 0)) + if (mutt_get_string_unbuffered (prompt, account->user, sizeof (account->user), 0)) return -1; } diff --git a/curs_lib.c b/curs_lib.c index 6402b43d..65398917 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -138,14 +138,14 @@ int _mutt_get_field (/* const */ char *field, char *buf, size_t buflen, int comp return (ret); } -int mutt_get_password (char *msg, char *buf, size_t buflen) +int mutt_get_string_unbuffered (char *msg, char *buf, size_t buflen, int flags) { int rc; CLEARLINE (LINES-1); addstr (msg); set_option (OPTUNBUFFEREDINPUT); - rc = mutt_enter_string (buf, buflen, LINES - 1, mutt_strlen (msg), M_PASS); + rc = mutt_enter_string (buf, buflen, LINES - 1, mutt_strlen (msg), flags); unset_option (OPTUNBUFFEREDINPUT); CLEARLINE (LINES-1); return (rc); diff --git a/protos.h b/protos.h index f8edff06..f9f7d928 100644 --- a/protos.h +++ b/protos.h @@ -293,7 +293,8 @@ int _mutt_enter_string (char *, size_t, int, int, int, int, char ***, int *, ENT #define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL) int _mutt_get_field (char *, char *, size_t, int, int, char ***, int *); int mutt_get_hook_type (const char *); -int mutt_get_password (char *, char *, size_t); +int mutt_get_string_unbuffered (char *, char *, size_t, int); +#define mutt_get_password(A,B,C) mutt_get_string_unbuffered(A,B,C,M_PASS) int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t); int mutt_get_tmp_attachment (BODY *); int mutt_index_menu (void); -- cgit v1.2.3