From 77791e773fdc98964403e104ed9164c7717962f3 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 3 Sep 2002 17:36:27 +0000 Subject: [PATCH] * wtools.c (real_input_dialog_help): Use a more reliable way to indicate password input. --- src/ChangeLog | 3 +++ src/wtools.c | 10 +++++----- src/wtools.h | 4 ++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 65607824a..dc22478a3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2002-09-03 Pavel Roskin + * wtools.c (real_input_dialog_help): Use a more reliable way + to indicate password input. + * boxes.c (display_widgets) [!HAVE_CHARSET]: Fix initialization. (vfs_smb_get_authinfo): Reuse another translated string. diff --git a/src/wtools.c b/src/wtools.c index 7305d7162..0b40af60f 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -452,12 +452,12 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te len = max (strlen (header), msglen (text, &lines)) + 4; len = max (len, 64); - /* Translators should take care as "Password" or its translations - are used to identify password boxes and hide characters with "*" */ - my_str = _("Password:"); - if (strncmp (text, my_str, strlen (my_str)-1) == 0){ + /* The special value of def_text is used to identify password boxes + and hide characters with "*". Don't save passwords in history! */ + if (def_text == INPUT_PASSWORD) { quick_widgets [INPUT_INDEX].value = 1; - tk_name[3]=0; + tk_name[3] = 0; + def_text = ""; } else { quick_widgets [INPUT_INDEX].value = 0; } diff --git a/src/wtools.h b/src/wtools.h index 7d677d65f..06f4524be 100644 --- a/src/wtools.h +++ b/src/wtools.h @@ -69,6 +69,10 @@ int run_chooser (Chooser *c); void destroy_chooser (Chooser *c); /* The input dialogs */ + +/* Pass this as def_text to request a password */ +#define INPUT_PASSWORD ((char *) -1) + char *input_dialog (char *header, char *text, char *def_text); char *input_dialog_help (char *header, char *text, char *help, char *def_text); char *input_expand_dialog (char *header, char *text, char *def_text); -- 2.11.4.GIT