Ticket #1580: mc segfaults when you try to use non-anonymous FTP

wtools.c: fix init of def_text for INPUT_PASSWORD special value

Signed-off-by: Stan. S. Krupoderov <pashelper@gmail.com>
This commit is contained in:
Stan. S. Krupoderov 2009-09-04 09:49:51 +04:00
parent a59d6f6ff0
commit e05778a4e4

View File

@ -1,7 +1,7 @@
/* Widget based utility functions.
Copyright (C) 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007 Free Software Foundation, Inc.
Authors: 1994, 1995, 1996 Miguel de Icaza
1994, 1995 Radek Doulik
1995 Jakub Jelinek
@ -456,7 +456,7 @@ quick_dialog (QuickDialog *qd)
* The argument "history_name" holds the name of a section
* in the history file. Data entered in the input field of
* the dialog box will be stored there.
*
*
*/
static char *
fg_input_dialog_help (const char *header, const char *text, const char *help,
@ -464,6 +464,11 @@ fg_input_dialog_help (const char *header, const char *text, const char *help,
{
char *my_str;
/* The special value of def_text is used to identify password boxes */
if (def_text == INPUT_PASSWORD) {
def_text = "";
}
QuickWidget quick_widgets[] = {
/* 0 */ QUICK_BUTTON (6, 10, 1, 0, N_("&Cancel"), B_CANCEL, NULL),
/* 1 */ QUICK_BUTTON (3, 10, 1, 0, N_("&OK"), B_ENTER, NULL),
@ -492,7 +497,6 @@ fg_input_dialog_help (const char *header, const char *text, const char *help,
if (def_text == INPUT_PASSWORD) {
quick_widgets[2].u.input.flags = 1;
histname[3] = '\0';
def_text = "";
}
#ifdef ENABLE_NLS
@ -570,7 +574,7 @@ char *input_dialog (const char *header, const char *text,
}
char *
input_expand_dialog (const char *header, const char *text,
input_expand_dialog (const char *header, const char *text,
const char *history_name, const char *def_text)
{
char *result;