FREE(choices[0]); FREE(choices[1]); FREE(choices[2]);
PUBLIC void LYoptions NOARGS{#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS    int itmp;#endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */    int response, ch;    /*     *	If the user changes the display we need memory to put it in.     */    char display_option[256];    char *choices[MAXCHOICES];    int CurrentCharSet = current_char_set;    int CurrentAssumeCharSet = UCLYhndl_for_unspec;    int CurrentShowColor = LYShowColor;    BOOLEAN CurrentRawMode = LYRawMode;    BOOLEAN AddValueAccepted = FALSE;    char *cp = NULL;    BOOL use_assume_charset, old_use_assume_charset;#ifdef DIRED_SUPPORT#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS    if (LYlines < 24) {	HTAlert(OPTION_SCREEN_NEEDS_24);	return;    }#else    if (LYlines < 23) {	HTAlert(OPTION_SCREEN_NEEDS_23);	return;    }#endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */#else#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS    if (LYlines < 23) {	HTAlert(OPTION_SCREEN_NEEDS_23);	return;    }#else    if (LYlines < 22) {	HTAlert(OPTION_SCREEN_NEEDS_22);	return;    }#endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */#endif /* DIRED_SUPPORT */    term_options = FALSE;    LYStatusLine = (LYlines - 1);	/* screen is otherwise too crowded */    signal(SIGINT, terminate_options);    if (no_option_save) {	if (LYShowColor == SHOW_COLOR_NEVER) {	    LYShowColor = SHOW_COLOR_OFF;	} else if (LYShowColor == SHOW_COLOR_ALWAYS) {	    LYShowColor = SHOW_COLOR_ON;	}#if defined(USE_SLANG) || defined(COLOR_CURSES)    } else {	if (LYChosenShowColor == SHOW_COLOR_UNKNOWN) {	    switch (LYrcShowColor) {	    case SHOW_COLOR_NEVER:		LYChosenShowColor =		    (LYShowColor >= SHOW_COLOR_ON) ?				     SHOW_COLOR_ON :				     SHOW_COLOR_NEVER;		break;	    case SHOW_COLOR_ALWAYS:#if defined(COLOR_CURSES)		if (!has_colors())		    LYChosenShowColor = SHOW_COLOR_ALWAYS;		else#endif		    LYChosenShowColor =			(LYShowColor >= SHOW_COLOR_ON) ?				     SHOW_COLOR_ALWAYS :				     SHOW_COLOR_OFF;		break;	    default:		LYChosenShowColor =		    (LYShowColor >= SHOW_COLOR_ON) ?				     SHOW_COLOR_ON :				     SHOW_COLOR_OFF;	    }	}#endif /* USE_SLANG || COLOR_CURSES */    }    old_use_assume_charset =	use_assume_charset = (user_mode == ADVANCED_MODE);draw_options:    old_use_assume_charset = use_assume_charset;    /*     *	NOTE that printw() should be avoided for strings that     *	might have non-ASCII or multibyte/CJK characters. - FM     */    response = 0;#if defined(FANCY_CURSES) || defined (USE_SLANG)    if (enable_scrollback) {	clear();    } else {	erase();    }#else    clear();#endif /* FANCY_CURSES || USE_SLANG */    move(0, 5);    lynx_start_h1_color ();    addstr("         Options Menu (");    addstr(LYNX_NAME);    addstr(" Version ");    addstr(LYNX_VERSION);    addch(')');    lynx_stop_h1_color ();    move(L_EDITOR, 5);    addlbl("(E)ditor                     : ");    addstr((editor && *editor) ? editor : "NONE");    move(L_DISPLAY, 5);    addlbl("(D)ISPLAY variable           : ");    addstr((x_display && *x_display) ? x_display : "NONE");    move(L_HOME, 5);    addlbl("mu(L)ti-bookmarks: ");    addstr((LYMultiBookmarks ?	      (LYMBMAdvanced ? "ADVANCED"			     : "STANDARD")			     : "OFF     "));    move(L_HOME, B_BOOK);    if (LYMultiBookmarks) {	addlbl("review/edit (B)ookmarks files");    } else {	addlbl("(B)ookmark file: ");	addstr((bookmark_page && *bookmark_page) ? bookmark_page : "NONE");    }    move(L_FTPSTYPE, 5);    addlbl("(F)TP sort criteria          : ");    addstr((HTfileSortMethod == FILE_BY_NAME ? "By Filename" :	   (HTfileSortMethod == FILE_BY_SIZE ? "By Size    " :	   (HTfileSortMethod == FILE_BY_TYPE ? "By Type    " :					       "By Date    "))));    move(L_MAIL_ADDRESS, 5);    addlbl("(P)ersonal mail address      : ");    addstr((personal_mail_address && *personal_mail_address) ?				       personal_mail_address : "NONE");    move(L_SSEARCH, 5);    addlbl("(S)earching type             : ");    addstr(case_sensitive ? "CASE SENSITIVE  " : "CASE INSENSITIVE");    move(L_Charset, 5);    addlbl("display (C)haracter set      : ");    addstr((char *)LYchar_set_names[current_char_set]);    move(L_LANGUAGE, 5);    addlbl("preferred document lan(G)uage: ");    addstr((language && *language) ? language : "NONE");    move(L_PREF_CHARSET, 5);    addlbl("preferred document c(H)arset : ");    addstr((pref_charset && *pref_charset) ? pref_charset : "NONE");    if (use_assume_charset) {	move(L_ASSUME_CHARSET, 5);	addlbl("(^A)ssume charset if unknown : ");	if (UCAssume_MIMEcharset)	    addstr(UCAssume_MIMEcharset);	else	    addstr((UCLYhndl_for_unspec >= 0) ?		   (char *)LYCharSet_UC[UCLYhndl_for_unspec].MIMEname					      : "NONE");    }    move(L_Rawmode, 5);    addlbl("Raw 8-bit or CJK m(O)de      : ");    addstr(LYRawMode ? "ON " : "OFF");#if defined(USE_SLANG) || defined(COLOR_CURSES)    move(L_Color, B_COLOR);    addlbl("show color (&)  : ");    if (no_option_save) {	addstr((LYShowColor == SHOW_COLOR_OFF ? "OFF" :						"ON "));    } else {	switch (LYChosenShowColor) {	case SHOW_COLOR_NEVER:		addstr("NEVER     ");		break;	case SHOW_COLOR_OFF:		addstr("OFF");		break;	case SHOW_COLOR_ON:		addstr("ON ");		break;	case SHOW_COLOR_ALWAYS:#if defined(COLOR_CURSES)		if (!has_colors())		    addstr("Always try");		else#endif		    addstr("ALWAYS    ");	}    }#endif /* USE_SLANG || COLOR_CURSES */    move(L_Bool_A, B_VIKEYS);    addlbl("(V)I keys: ");    addstr(vi_keys ? "ON " : "OFF");    move(L_Bool_A, B_EMACSKEYS);    addlbl("e(M)acs keys: ");    addstr(emacs_keys ? "ON " : "OFF");    move(L_Bool_A, B_SHOW_DOTFILES);    addlbl("sho(W) dot files: ");    addstr((!no_dotfiles && show_dotfiles) ? "ON " : "OFF");    move(L_Bool_B, B_SELECT_POPUPS);    addlbl("popups for selec(T) fields   : ");    addstr(LYSelectPopups ? "ON " : "OFF");    move(L_Bool_B, B_SHOW_CURSOR);    addlbl("show cursor (@) : ");    addstr(LYShowCursor ? "ON " : "OFF");    move(L_Keypad, 5);    addlbl("(K)eypad mode                : ");    addstr((keypad_mode == NUMBERS_AS_ARROWS) ?				"Numbers act as arrows             " :	 ((keypad_mode == LINKS_ARE_NUMBERED) ?				"Links are numbered                " :				"Links and form fields are numbered"));    move(L_Lineed, 5);    addlbl("li(N)e edit style            : ");    addstr(LYLineeditNames[current_lineedit]);#ifdef EXP_KEYBOARD_LAYOUT    move(L_Layout, 5);    addlbl("Ke(Y)board layout            : ");    addstr(LYKbLayoutNames[current_layout]);#endif#ifdef DIRED_SUPPORT    move(L_Dired, 5);    addlbl("l(I)st directory style       : ");    addstr((dir_list_style == FILES_FIRST) ? "Files first      " :	  ((dir_list_style == MIXED_STYLE) ? "Mixed style      " :					     "Directories first"));#endif /* DIRED_SUPPORT */    move(L_User_Mode, 5);    addlbl("(U)ser mode                  : ");    addstr(  (user_mode == NOVICE_MODE) ? "Novice      " :      ((user_mode == INTERMEDIATE_MODE) ? "Intermediate" :					  "Advanced    "));    addlbl("  verbose images (!) : ");    addstr( verbose_img ? "ON " : "OFF" );    move(L_User_Agent, 5);    addlbl("user (A)gent                 : ");    addstr((LYUserAgent && *LYUserAgent) ? LYUserAgent : "NONE");#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS    move(L_Exec, 5);    addlbl("local e(X)ecution links      : ");#ifndef NEVER_ALLOW_REMOTE_EXEC    addstr(               local_exec ? "ALWAYS ON           " :	  (local_exec_on_local_files ? "FOR LOCAL FILES ONLY" :				       "ALWAYS OFF          "));#else    addstr(local_exec_on_local_files ? "FOR LOCAL FILES ONLY" :				       "ALWAYS OFF          ");#endif /* !NEVER_ALLOW_REMOTE_EXEC */#endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */    move(LYlines-3, 2);    addstr(SELECT_SEGMENT);    start_bold();    addstr(CAP_LETT_SEGMENT);    stop_bold();    addstr(OF_OPT_LINE_SEGMENT);    if (!no_option_save) {	addstr(" '");	start_bold();	addstr(">");	stop_bold();	addstr("'");	addstr(TO_SAVE_SEGMENT);    }    addstr(OR_SEGMENT);    addstr("'");    start_bold();    addstr("r");    stop_bold();    addstr("'");    addstr(TO_RETURN_SEGMENT);    while (TOUPPER(response) != 'R' &&	   !LYisNonAlnumKeyname(response, LYK_PREV_DOC) &&	   response != '>' && !term_options &&	   response != 7 &&  response != 3) {	if (AddValueAccepted == TRUE) {	    _statusline(VALUE_ACCEPTED);	    AddValueAccepted = FALSE;	}	move((LYlines - 2), 0);	lynx_start_prompt_color ();	addstr(COMMAND_PROMPT);	lynx_stop_prompt_color ();	refresh();	response = LYgetch();	if (term_options || response == 7 || response == 3)	    response = 'R';	if (LYisNonAlnumKeyname(response, LYK_REFRESH)) {	    lynx_force_repaint();	    goto draw_options;	}	switch (response) {	    case 'e':	/* Change the editor. */	    case 'E':		if (no_editor) {		    _statusline(EDIT_DISABLED);		} else if (system_editor ) {		    _statusline(EDITOR_LOCKED);		} else {		    if (editor && *editor)			strcpy(display_option, editor);		    else {  /* clear the NONE */			move(L_EDITOR, COL_OPTION_VALUES);			addstr("    ");			*display_option = '\0';		    }		    _statusline(ACCEPT_DATA);		    move(L_EDITOR, COL_OPTION_VALUES);		    start_bold();		    ch = LYgetstr(display_option, VISIBLE,				  sizeof(display_option), NORECALL);		    stop_bold();		    move(L_EDITOR, COL_OPTION_VALUES);		    if (term_options || ch == -1) {			addstr((editor && *editor) ?					    editor : "NONE");		    } else if (*display_option == '\0') {			FREE(editor);			addstr("NONE");		    } else {			StrAllocCopy(editor, display_option);			addstr(display_option);		    }		    clrtoeol();		    if (ch == -1) {			HTInfoMsg(CANCELLED);			HTInfoMsg("");		    } else {			_statusline(VALUE_ACCEPTED);		    }		}		response = ' ';		break;	    case 'd':	/* Change the display. */	    case 'D':		if (x_display && *x_display) {		    strcpy(display_option, x_display);		} else {  /* clear the NONE */		    move(L_DISPLAY, COL_OPTION_VALUES);		    addstr("    ");		    *display_option = '\0';		}		_statusline(ACCEPT_DATA);		move(L_DISPLAY, COL_OPTION_VALUES);		start_bold();		ch = LYgetstr(display_option, VISIBLE,			      sizeof(display_option), NORECALL);		stop_bold();		move(L_DISPLAY, COL_OPTION_VALUES);		if ((term_options || ch == -1) ||		    (x_display != NULL &&#ifdef VMS		     !strcasecomp(x_display, display_option)))#else		     !strcmp(x_display, display_option)))#endif /* VMS */		{		    /*		     *	Cancelled, or a non-NULL display string		     *	wasn't changed. - FM		     */		    addstr((x_display && *x_display) ? x_display : "NONE");		    clrtoeol();		    if (ch == -1) {			HTInfoMsg(CANCELLED);			HTInfoMsg("");		    } else {			_statusline(VALUE_ACCEPTED);		    }		    response = ' ';		    break;		} else if (*display_option == '\0') {		    if ((x_display == NULL) ||			(x_display != NULL && *x_display == '\0')) {			/*			 *  NULL or zero-length display string			 *  wasn't changed. - FM			 */			addstr("NONE");			clrtoeol();			_statusline(VALUE_ACCEPTED);			response = ' ';			break;		    }		}		/*		 *  Set the new DISPLAY variable. - FM		 */		LYsetXDisplay(display_option);		if ((cp = LYgetXDisplay()) != NULL) {		    StrAllocCopy(x_display, cp);		} else {		    FREE(x_display);		}		cp = NULL;		addstr(x_display ? x_display : "NONE");		clrtoeol();		if ((x_display == NULL && *display_option == '\0') ||		    (x_display != NULL &&		     !strcmp(x_display, display_option))) {		    if (x_display == NULL &&			LYisConfiguredForX == TRUE) {			_statusline(VALUE_ACCEPTED_WARNING_X);		    } else if (x_display != NULL &&			LYisConfiguredForX == FALSE) {			_statusline(VALUE_ACCEPTED_WARNING_NONX);		    } else {			_statusline(VALUE_ACCEPTED);		    }		} else {		    if (*display_option) {			_statusline(FAILED_TO_SET_DISPLAY);		    } else {			_statusline(FAILED_CLEAR_SET_DISPLAY);		    }		}		response = ' ';		break;	    case 'l':	/* Change multibookmarks option. */	    case 'L':		if (LYMBMBlocked) {		    _statusline(MULTIBOOKMARKS_DISALLOWED);		    response = ' ';		    break;		}		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF     ");		choices[1] = NULL;		StrAllocCopy(choices[1], "STANDARD");		choices[2] = NULL;		StrAllocCopy(choices[2], "ADVANCED");		choices[3] = NULL;		if (!LYSelectPopups) {		    LYMultiBookmarks = boolean_choice((LYMultiBookmarks *						       (1 + LYMBMAdvanced)),						      L_HOME, C_MULTI,						      choices);		} else {		    LYMultiBookmarks = popup_choice((LYMultiBookmarks *						     (1 + LYMBMAdvanced)),						    L_HOME, (C_MULTI - 1),						    choices,						    3, FALSE);		}		if (LYMultiBookmarks == 2) {		    LYMultiBookmarks = TRUE;		    LYMBMAdvanced = TRUE;		} else {		    LYMBMAdvanced = FALSE;		}#if defined(VMS) || defined(USE_SLANG)		if (LYSelectPopups) {		    move(L_HOME, C_MULTI);		    clrtoeol();		    addstr(choices[(LYMultiBookmarks * (1 + LYMBMAdvanced))]);		}#endif /* VMS || USE_SLANG */		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);#if !defined(VMS) && !defined(USE_SLANG)		if (!LYSelectPopups)#endif /* !VMS && !USE_SLANG */		{		    move(L_HOME, B_BOOK);		    clrtoeol();		    if (LYMultiBookmarks) {			addstr(gettext("review/edit B)ookmarks files"));		    } else {			addstr(gettext("B)ookmark file: "));			addstr((bookmark_page && *bookmark_page) ?						   bookmark_page : "NONE");		    }		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;	    case 'b':	/* Change the bookmark page location. */	    case 'B':		/*		 *  Anonymous users should not be allowed to		 *  change the bookmark page.		 */		if (!no_bookmark) {		    if (LYMultiBookmarks) {			edit_bookmarks();			signal(SIGINT, terminate_options);			goto draw_options;		    }		    if (bookmark_page && *bookmark_page) {			strcpy(display_option, bookmark_page);		    } else {  /* clear the NONE */			move(L_HOME, C_DEFAULT);			clrtoeol();			*display_option = '\0';		    }		    _statusline(ACCEPT_DATA);		    move(L_HOME, C_DEFAULT);		    start_bold();		    ch = LYgetstr(display_option, VISIBLE,				  sizeof(display_option), NORECALL);		    stop_bold();		    move(L_HOME, C_DEFAULT);		    if (term_options ||			ch == -1 || *display_option == '\0') {			addstr((bookmark_page && *bookmark_page) ?						   bookmark_page : "NONE");		    } else if (!LYPathOffHomeOK(display_option,						sizeof(display_option))) {			addstr((bookmark_page && *bookmark_page) ?						   bookmark_page : "NONE");			clrtoeol();			_statusline(USE_PATH_OFF_HOME);			response = ' ';			break;		    } else {			StrAllocCopy(bookmark_page, display_option);			StrAllocCopy(MBM_A_subbookmark[0],				     bookmark_page);			addstr(bookmark_page);		    }		    clrtoeol();		    if (ch == -1) {			HTInfoMsg(CANCELLED);			HTInfoMsg("");		    } else {			_statusline(VALUE_ACCEPTED);		    }		} else { /* anonymous */		    _statusline(BOOKMARK_CHANGE_DISALLOWED);		}		response = ' ';		break;	    case 'f':	/* Change ftp directory sorting. */	    case 'F':	/*  (also local for non-DIRED)	 */		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "By Filename");		choices[1] = NULL;		StrAllocCopy(choices[1], "By Type    ");		choices[2] = NULL;		StrAllocCopy(choices[2], "By Size    ");		choices[3] = NULL;		StrAllocCopy(choices[3], "By Date    ");		choices[4] = NULL;		if (!LYSelectPopups) {		    HTfileSortMethod = boolean_choice(HTfileSortMethod,						      L_FTPSTYPE, -1,						      choices);		} else {		    HTfileSortMethod = popup_choice(HTfileSortMethod,						    L_FTPSTYPE, -1,						    choices,						    4, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_FTPSTYPE, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[HTfileSortMethod]);#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		FREE(choices[3]);		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;	    case 'p': /* Change personal mail address for From headers. */	    case 'P':		if (personal_mail_address && *personal_mail_address) {		    strcpy(display_option, personal_mail_address);		} else {  /* clear the NONE */		    move(L_MAIL_ADDRESS, COL_OPTION_VALUES);		    addstr("    ");		    *display_option = '\0';		}		_statusline(ACCEPT_DATA);		move(L_MAIL_ADDRESS, COL_OPTION_VALUES);		start_bold();		ch = LYgetstr(display_option, VISIBLE,			      sizeof(display_option), NORECALL);		stop_bold();		move(L_MAIL_ADDRESS, COL_OPTION_VALUES);		if (term_options || ch == -1) {		    addstr((personal_mail_address &&			    *personal_mail_address) ?			      personal_mail_address : "NONE");		} else if (*display_option == '\0') {		    FREE(personal_mail_address);		    addstr("NONE");		} else {		    StrAllocCopy(personal_mail_address, display_option);		    addstr(display_option);		}		clrtoeol();		if (ch == -1) {		    HTInfoMsg(CANCELLED);		    HTInfoMsg("");		} else {		    _statusline(VALUE_ACCEPTED);		}		response = ' ';		break;	    case 's':	/* Change case sensitivity for searches. */	    case 'S':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "CASE INSENSITIVE");		choices[1] = NULL;		StrAllocCopy(choices[1], "CASE SENSITIVE  ");		choices[2] = NULL;		case_sensitive = boolean_choice(case_sensitive,						L_SSEARCH, -1, choices);		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case '\001':	/* Change assume_charset setting. */		if (use_assume_charset) {		    int i, curval;		    char ** assume_list;		    assume_list = (char **)calloc(LYNumCharsets + 1, sizeof(char *));		    if (!assume_list) {			outofmem(__FILE__, "options");		    }		    for (i = 0; i < LYNumCharsets; i++) {			assume_list[i] = (char *)LYCharSet_UC[i].MIMEname;		    }		    curval = UCLYhndl_for_unspec;		    if (curval == current_char_set && UCAssume_MIMEcharset) {			curval = UCGetLYhndl_byMIME(UCAssume_MIMEcharset);		    }		    if (curval < 0)			curval = LYRawMode ? current_char_set : 0;		    if (!LYSelectPopups) {			UCLYhndl_for_unspec = boolean_choice(curval,							     L_ASSUME_CHARSET, -1,							     assume_list);		    } else {			UCLYhndl_for_unspec = popup_choice(curval,							   L_ASSUME_CHARSET, -1,							   assume_list,							   0, FALSE);#if defined(VMS) || defined(USE_SLANG)			move(L_ASSUME_CHARSET, COL_OPTION_VALUES);			clrtoeol();			if (UCLYhndl_for_unspec >= 0)			    addstr((char *)				   LYCharSet_UC[UCLYhndl_for_unspec].MIMEname);#endif /* VMS || USE_SLANG */		    }		    /*		     *	Set the raw 8-bit or CJK mode defaults and		     *	character set if changed. - FM		     */		    if (CurrentAssumeCharSet != UCLYhndl_for_unspec ||			UCLYhndl_for_unspec != curval) {			if (UCLYhndl_for_unspec != CurrentAssumeCharSet) {			    StrAllocCopy(UCAssume_MIMEcharset,					 LYCharSet_UC[UCLYhndl_for_unspec].MIMEname);			}			LYRawMode = (UCLYhndl_for_unspec == current_char_set);			HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);			HTMLSetCharacterHandling(current_char_set);			CurrentAssumeCharSet = UCLYhndl_for_unspec;			CurrentRawMode = LYRawMode;#if !defined(VMS) && !defined(USE_SLANG)			if (!LYSelectPopups)#endif /* !VMS && !USE_SLANG */			{			    move(L_Rawmode, COL_OPTION_VALUES);			    clrtoeol();			    addstr(LYRawMode ? "ON " : "OFF");			}		    }		    FREE(assume_list);		    response = ' ';		    if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)			if (term_options) {			    term_options = FALSE;			} else {			    AddValueAccepted = TRUE;			}			goto draw_options;#else			term_options = FALSE;#endif /* !VMS || USE_SLANG */		    }		} else {		    _statusline(NEED_ADVANCED_USER_MODE);		    AddValueAccepted = FALSE;		}		break;	    case 'c':	/* Change display charset setting. */	    case 'C':		if (!LYSelectPopups) {		    current_char_set = boolean_choice(current_char_set,						      L_Charset, -1,						      (char **)LYchar_set_names);		} else {		    current_char_set = popup_choice(current_char_set,						    L_Charset, -1,						    (char **)LYchar_set_names,						    0, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Charset, COL_OPTION_VALUES);		    clrtoeol();		    addstr((char *)LYchar_set_names[current_char_set]);#endif /* VMS || USE_SLANG */		}		/*		 *  Set the raw 8-bit or CJK mode defaults and		 *  character set if changed. - FM		 */		if (CurrentCharSet != current_char_set) {		    LYUseDefaultRawMode = TRUE;		    HTMLUseCharacterSet(current_char_set);		    CurrentCharSet = current_char_set;		    CurrentRawMode = LYRawMode;#if !defined(VMS) && !defined(USE_SLANG)		    if (!LYSelectPopups)#endif /* !VMS && !USE_SLANG */		    {			move(L_Rawmode, COL_OPTION_VALUES);			clrtoeol();			addstr(LYRawMode ? "ON " : "OFF");		    }		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;	    case 'o':	/* Change raw mode setting. */	    case 'O':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		LYRawMode = boolean_choice(LYRawMode, L_Rawmode, -1, choices);		/*		 *  Set the LYUseDefaultRawMode value and character		 *  handling if LYRawMode was changed. - FM		 */		if (CurrentRawMode != LYRawMode) {		    HTMLSetUseDefaultRawMode(current_char_set, LYRawMode);		    HTMLSetCharacterHandling(current_char_set);		    CurrentRawMode = LYRawMode;		}		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'g':	/* Change language preference. */	    case 'G':		if (language && *language) {		    strcpy(display_option, language);		} else {  /* clear the NONE */		    move(L_LANGUAGE, COL_OPTION_VALUES);		    addstr("    ");		    *display_option = '\0';		}		_statusline(ACCEPT_DATA);		move(L_LANGUAGE, COL_OPTION_VALUES);		start_bold();		ch = LYgetstr(display_option, VISIBLE,			      sizeof(display_option), NORECALL);		stop_bold();		move(L_LANGUAGE, COL_OPTION_VALUES);		if (term_options || ch == -1) {		    addstr((language && *language) ?					  language : "NONE");		} else if (*display_option == '\0') {		    FREE(language);		    addstr("NONE");		} else {		    StrAllocCopy(language, display_option);		    addstr(display_option);		}		clrtoeol();		if (ch == -1) {		    HTInfoMsg(CANCELLED);		    HTInfoMsg("");		} else {		    _statusline(VALUE_ACCEPTED);		}		response = ' ';		break;	    case 'h':	/* Change charset preference. */	    case 'H':		if (pref_charset && *pref_charset) {		    strcpy(display_option, pref_charset);		} else {  /* clear the NONE */		    move(L_PREF_CHARSET, COL_OPTION_VALUES);		    addstr("    ");		    *display_option = '\0';		}		_statusline(ACCEPT_DATA);		move(L_PREF_CHARSET, COL_OPTION_VALUES);		start_bold();		ch = LYgetstr(display_option, VISIBLE,			      sizeof(display_option), NORECALL);		stop_bold();		move(L_PREF_CHARSET, COL_OPTION_VALUES);		if (term_options || ch == -1) {		    addstr((pref_charset && *pref_charset) ?			   pref_charset : "NONE");		} else if (*display_option == '\0') {		    FREE(pref_charset);		    addstr("NONE");		} else {		    StrAllocCopy(pref_charset, display_option);		    addstr(display_option);		}		clrtoeol();		if (ch == -1) {		    HTInfoMsg(CANCELLED);		    HTInfoMsg("");		} else {		    _statusline(VALUE_ACCEPTED);		}		response = ' ';		break;	    case 'v':	/* Change VI keys setting. */	    case 'V':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		vi_keys = boolean_choice(vi_keys,					 L_Bool_A, C_VIKEYS,					 choices);		if (vi_keys) {		    set_vi_keys();		} else {		    reset_vi_keys();		}		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'M':	/* Change emacs keys setting. */	    case 'm':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		emacs_keys = boolean_choice(emacs_keys,					    L_Bool_A, C_EMACSKEYS,					    choices);		if (emacs_keys) {		    set_emacs_keys();		} else {		    reset_emacs_keys();		}		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'W':	/* Change show dotfiles setting. */	    case 'w':		if (no_dotfiles) {		    _statusline(DOTFILE_ACCESS_DISABLED);		} else {		    /*		     *	Copy strings into choice array.		     */		    choices[0] = NULL;		    StrAllocCopy(choices[0], "OFF");		    choices[1] = NULL;		    StrAllocCopy(choices[1], "ON ");		    choices[2] = NULL;		    show_dotfiles = boolean_choice(show_dotfiles,						   L_Bool_A,						   C_SHOW_DOTFILES,						   choices);		    FREE(choices[0]);		    FREE(choices[1]);		}		response = ' ';		break;	    case 't':	/* Change select popups setting. */	    case 'T':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		LYSelectPopups = boolean_choice(LYSelectPopups,						L_Bool_B,						C_SELECT_POPUPS,						choices);		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;#if defined(USE_SLANG) || defined(COLOR_CURSES)	    case '&':	/* Change show color setting. */		if (no_option_save) {#if defined(COLOR_CURSES)		    if (!has_colors()) {			char * terminal = getenv("TERM");			if (terminal)			    HTUserMsg2(				COLOR_TOGGLE_DISABLED_FOR_TERM,				terminal);			else			    HTUserMsg(COLOR_TOGGLE_DISABLED);		    }#endif		/*		 *  Copy strings into choice array.		 */		    choices[0] = NULL;		    StrAllocCopy(choices[0], "OFF");		    choices[1] = NULL;		    StrAllocCopy(choices[1], "ON ");		    choices[2] = NULL;		    LYShowColor = boolean_choice((LYShowColor - 1),						 L_Color,						 C_COLOR,						 choices);		    if (LYShowColor == 0) {			LYShowColor = SHOW_COLOR_OFF;		    } else {			LYShowColor = SHOW_COLOR_ON;		    }		} else {		/* !no_option_save */		    BOOLEAN again = FALSE;		    int chosen;		/*		 *  Copy strings into choice array.		 */		    choices[0] = NULL;		    StrAllocCopy(choices[0], "NEVER     ");		    choices[1] = NULL;		    StrAllocCopy(choices[1], "OFF       ");		    choices[2] = NULL;		    StrAllocCopy(choices[2], "ON        ");		    choices[3] = NULL;#if defined(COLOR_CURSES)		    if (!has_colors())			StrAllocCopy(choices[3], "Always try");		    else#endif			StrAllocCopy(choices[3], "ALWAYS    ");		    choices[4] = NULL;		    do {			if (!LYSelectPopups) {			    chosen = boolean_choice(LYChosenShowColor,						    L_Color,						    C_COLOR,						    choices);			} else {			    chosen = popup_choice(LYChosenShowColor,						  L_Color,						  C_COLOR,						  choices, 4, FALSE);			}#if defined(COLOR_CURSES)			again = (chosen == 2 && !has_colors());			if (again) {			    char * terminal = getenv("TERM");			    if (terminal)				HTUserMsg2(				    COLOR_TOGGLE_DISABLED_FOR_TERM,				    terminal);			    else				HTUserMsg(COLOR_TOGGLE_DISABLED);			}#endif		    } while (again);		    LYChosenShowColor = chosen;#if defined(VMS)		    if (LYSelectPopups) {			move(L_Color, C_COLOR);			clrtoeol();			addstr(choices[LYChosenShowColor]);		    }#endif /* VMS */#if defined(COLOR_CURSES)		    if (has_colors())#endif			LYShowColor = chosen;		    FREE(choices[2]);		    FREE(choices[3]);		}		FREE(choices[0]);		FREE(choices[1]);		if (CurrentShowColor != LYShowColor) {		    lynx_force_repaint();		}		CurrentShowColor = LYShowColor;#ifdef USE_SLANG		SLtt_Use_Ansi_Colors = (LYShowColor > 1 ? 1 : 0);#endif		response = ' ';		if (LYSelectPopups && !no_option_save) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#endif /* USE_SLANG or COLOR_CURSES */	    case '@':	/* Change show cursor setting. */		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		LYShowCursor = boolean_choice(LYShowCursor,					      L_Bool_B,					      C_SHOW_CURSOR,					      choices);		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		break;	    case 'k':	/* Change keypad mode. */	    case 'K':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0],			     "Numbers act as arrows             ");		choices[1] = NULL;		StrAllocCopy(choices[1],			     "Links are numbered                ");		choices[2] = NULL;		StrAllocCopy(choices[2],			     "Links and form fields are numbered");		choices[3] = NULL;		if (!LYSelectPopups) {		    keypad_mode = boolean_choice(keypad_mode,						 L_Keypad, -1,						 choices);		} else {		    keypad_mode = popup_choice(keypad_mode,					       L_Keypad, -1,					       choices,					       3, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Keypad, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[keypad_mode]);#endif /* VMS || USE_SLANG */		}		if (keypad_mode == NUMBERS_AS_ARROWS) {		    set_numbers_as_arrows();		} else {		    reset_numbers_as_arrows();		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;	    case 'n':	/* Change line editor key bindings. */	    case 'N':		if (!LYSelectPopups) {		    current_lineedit = boolean_choice(current_lineedit,						      L_Lineed, -1,						      LYLineeditNames);		} else {		    current_lineedit = popup_choice(current_lineedit,						    L_Lineed, -1,						    LYLineeditNames,						    0, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Lineed, COL_OPTION_VALUES);		    clrtoeol();		    addstr(LYLineeditNames[current_lineedit]);#endif /* VMS || USE_SLANG */		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#ifdef EXP_KEYBOARD_LAYOUT	    case 'y':	/* Change keyboard layout */	    case 'Y':		if (!LYSelectPopups) {		    current_layout = boolean_choice(current_layout,						      L_Layout, -1,						      LYKbLayoutNames);		} else {		    current_layout = popup_choice(current_layout,						    L_Layout, -1,						    LYKbLayoutNames,						    0, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Layout, COL_OPTION_VALUES);		    clrtoeol();		    addstr(LYKbLayoutNames[current_layout]);#endif /* VMS || USE_SLANG */		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#endif /* EXP_KEYBOARD_LAYOUT */#ifdef DIRED_SUPPORT	    case 'i':	/* Change local directory sorting. */	    case 'I':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "Directories first");		choices[1] = NULL;		StrAllocCopy(choices[1], "Files first      ");		choices[2] = NULL;		StrAllocCopy(choices[2], "Mixed style      ");		choices[3] = NULL;		if (!LYSelectPopups) {		    dir_list_style = boolean_choice(dir_list_style,						    L_Dired, -1,						    choices);		} else {		    dir_list_style = popup_choice(dir_list_style,						  L_Dired, -1,						  choices,						  3, FALSE);#if defined(VMS) || defined(USE_SLANG)		    move(L_Dired, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[dir_list_style]);#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#endif /* DIRED_SUPPORT */	    case 'u':	/* Change user mode. */	    case 'U':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "Novice      ");		choices[1] = NULL;		StrAllocCopy(choices[1], "Intermediate");		choices[2] = NULL;		StrAllocCopy(choices[2], "Advanced    ");		choices[3] = NULL;		if (!LYSelectPopups) {		    user_mode = boolean_choice(user_mode,					       L_User_Mode, -1,					       choices);		    use_assume_charset = (user_mode >= 2);		} else {		    user_mode = popup_choice(user_mode,					     L_User_Mode, -1,					     choices,					     3, FALSE);		    use_assume_charset = (user_mode >= 2);#if defined(VMS) || defined(USE_SLANG)		    if (use_assume_charset == old_use_assume_charset) {			move(L_User_Mode, COL_OPTION_VALUES);			clrtoeol();			addstr(choices[user_mode]);		    }#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);		FREE(choices[2]);		if (user_mode == NOVICE_MODE) {		    display_lines = (LYlines - 4);		} else {		    display_lines = LYlines-2;		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;		    if (use_assume_charset != old_use_assume_charset)			goto draw_options;#endif /* !VMS || USE_SLANG */		}		break;	    case '!':		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "OFF");		choices[1] = NULL;		StrAllocCopy(choices[1], "ON ");		choices[2] = NULL;		if (!LYSelectPopups) {		    verbose_img = boolean_choice(verbose_img,						L_VERBOSE_IMAGES,						C_VERBOSE_IMAGES,						choices);		} else {		    verbose_img = popup_choice(verbose_img,					     L_VERBOSE_IMAGES,					     C_VERBOSE_IMAGES,					     choices,					     2, FALSE);		}		FREE(choices[0]);		FREE(choices[1]);		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;		    if (use_assume_charset != old_use_assume_charset)			goto draw_options;#endif /* !VMS || USE_SLANG */		}		break;	    case 'a':	/* Change user agent string. */	    case 'A':		if (!no_useragent) {		    if (LYUserAgent && *LYUserAgent) {			strcpy(display_option, LYUserAgent);		    } else {  /* clear the NONE */			move(L_HOME, COL_OPTION_VALUES);			addstr("    ");			*display_option = '\0';		    }		    _statusline(ACCEPT_DATA_OR_DEFAULT);		    move(L_User_Agent, COL_OPTION_VALUES);		    start_bold();		    ch = LYgetstr(display_option, VISIBLE,				  sizeof(display_option), NORECALL);		    stop_bold();		    move(L_User_Agent, COL_OPTION_VALUES);		    if (term_options || ch == -1) {			addstr((LYUserAgent &&				*LYUserAgent) ?				  LYUserAgent : "NONE");		    } else if (*display_option == '\0') {			StrAllocCopy(LYUserAgent, LYUserAgentDefault);			addstr((LYUserAgent &&				*LYUserAgent) ?				  LYUserAgent : "NONE");		    } else {			StrAllocCopy(LYUserAgent, display_option);			addstr(display_option);		    }		    clrtoeol();		    if (ch == -1) {			HTInfoMsg(CANCELLED);			HTInfoMsg("");		    } else if (LYUserAgent && *LYUserAgent &&			!strstr(LYUserAgent, "Lynx") &&			!strstr(LYUserAgent, "lynx")) {			_statusline(UA_COPYRIGHT_WARNING);		    } else {			_statusline(VALUE_ACCEPTED);		    }		} else { /* disallowed */		    _statusline(UA_COPYRIGHT_WARNING);		}		response = ' ';		break;#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS	    case 'x':	/* Change local exec restriction. */	    case 'X':		if (exec_frozen && !LYSelectPopups) {		    _statusline(CHANGE_OF_SETTING_DISALLOWED);		    response = ' ';		    break;		}#ifndef NEVER_ALLOW_REMOTE_EXEC		if (local_exec) {		    itmp = 2;		} else#endif /* !NEVER_ALLOW_REMOTE_EXEC */		{		    if (local_exec_on_local_files) {			itmp= 1;		    } else {			itmp = 0;		    }		}		/*		 *  Copy strings into choice array.		 */		choices[0] = NULL;		StrAllocCopy(choices[0], "ALWAYS OFF          ");		choices[1] = NULL;		StrAllocCopy(choices[1], "FOR LOCAL FILES ONLY");		choices[2] = NULL;#ifndef NEVER_ALLOW_REMOTE_EXEC		StrAllocCopy(choices[2], "ALWAYS ON           ");		choices[3] = NULL;#endif /* !NEVER_ALLOW_REMOTE_EXEC */		if (!LYSelectPopups) {		    itmp = boolean_choice(itmp,					  L_Exec, -1,					  choices);		} else {		    itmp = popup_choice(itmp,					L_Exec, -1,					choices,					0, (exec_frozen ? TRUE : FALSE));#if defined(VMS) || defined(USE_SLANG)		    move(L_Exec, COL_OPTION_VALUES);		    clrtoeol();		    addstr(choices[itmp]);#endif /* VMS || USE_SLANG */		}		FREE(choices[0]);		FREE(choices[1]);#ifndef NEVER_ALLOW_REMOTE_EXEC		FREE(choices[2]);#endif /* !NEVER_ALLOW_REMOTE_EXEC */		if (!exec_frozen) {		    switch (itmp) {			case 0:			    local_exec = FALSE;			    local_exec_on_local_files = FALSE;			    break;			case 1:			    local_exec = FALSE;			    local_exec_on_local_files = TRUE;			    break;#ifndef NEVER_ALLOW_REMOTE_EXEC			case 2:			    local_exec = TRUE;			    local_exec_on_local_files = FALSE;			    break;#endif /* !NEVER_ALLOW_REMOTE_EXEC */		    } /* end switch */		}		response = ' ';		if (LYSelectPopups) {#if !defined(VMS) || defined(USE_SLANG)		    if (exec_frozen || term_options) {			term_options = FALSE;		    } else {			AddValueAccepted = TRUE;		    }		    goto draw_options;#else		    term_options = FALSE;#endif /* !VMS || USE_SLANG */		}		break;#endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */	    case '>':	/* Save current options to RC file. */		if (!no_option_save) {		    _statusline(SAVING_OPTIONS);		    if (save_rc()) {			LYrcShowColor = LYChosenShowColor;			_statusline(OPTIONS_SAVED);		    } else {			HTAlert(OPTIONS_NOT_SAVED);		    }		} else {		    _statusline(R_TO_RETURN_TO_LYNX);		    /*		     *	Change response so that we don't exit		     *	the options menu.		     */		    response = ' ';		}		break;	    case 'r':	/* Return to document (quit options menu). */	    case 'R':		break;	    default:		if (!no_option_save) {		    _statusline(SAVE_OR_R_TO_RETURN_TO_LYNX);		} else {		    _statusline(R_TO_RETURN_TO_LYNX);		}	}  /* end switch */    }  /* end while */    term_options = FALSE;    LYStatusLine = -1;		/* let user_mode have some of the screen */    signal(SIGINT, cleanup_sig);}