CTRACE(tfp, "LYHandleSELECT: Ignoring SIZE=\"%s\" for SELECT.\n", value[HTML_SELECT_SIZE]); #endif
CTRACE((tfp, "LYHandleSELECT: Ignoring SIZE=\"%s\" for SELECT.\n", value[HTML_SELECT_SIZE]));
PUBLIC void LYHandleSELECT ARGS5(	HTStructured *, 	me,	CONST BOOL*,		present,	CONST char **,		value,	char **,		include GCC_UNUSED,	BOOL,			start){    int i;    if (start == TRUE) {	char *name = NULL;	BOOLEAN multiple = NO;	char *size = NULL;	/*	 *  Initialize the disable attribute.	 */	me->select_disabled = FALSE;	/*	 *  Make sure we're in a form.	 */	if (!me->inFORM) {	    if (TRACE) {		fprintf(tfp,			"Bad HTML: SELECT start tag not within FORM tag\n");	    } else if (!me->inBadHTML) {		HTUserMsg(BAD_HTML_USE_TRACE);		me->inBadHTML = TRUE;	    }	    /*	     *	We should have covered all crash possibilities with the	     *	current TagSoup parser, so we'll allow it because some	     *	people with other browsers use SELECT for "information"	     *	popups, outside of FORM blocks, though no Lynx user	     *	would do anything that awful, right? - FM	     *//***	    return;		***/	}	/*	 *  Check for unclosed TEXTAREA.	 */	if (me->inTEXTAREA) {	    if (TRACE) {		fprintf(tfp, "Bad HTML: Missing TEXTAREA end tag\n");	    } else if (!me->inBadHTML) {		HTUserMsg(BAD_HTML_USE_TRACE);		me->inBadHTML = TRUE;	    }	}	/*	 *  Set to know we are in a select tag.	 */	me->inSELECT = TRUE;	if (!(present && present[HTML_SELECT_NAME] &&	      value[HTML_SELECT_NAME]  && *value[HTML_SELECT_NAME])) {	    StrAllocCopy(name, "");	} else if (strchr(value[HTML_SELECT_NAME], '&') == NULL) {	    StrAllocCopy(name, value[HTML_SELECT_NAME]);	} else {	    StrAllocCopy(name, value[HTML_SELECT_NAME]);	    UNESCAPE_FIELDNAME_TO_STD(&name);	}	if (present && present[HTML_SELECT_MULTIPLE])	    multiple=YES;	if (present && present[HTML_SELECT_DISABLED])	    me->select_disabled = TRUE;	if (present && present[HTML_SELECT_SIZE] &&	    value[HTML_SELECT_SIZE] && *value[HTML_SELECT_SIZE]) {#ifdef NOTDEFINED	    StrAllocCopy(size, value[HTML_SELECT_SIZE]);#else	    /*	     *	Let the size be determined by the number of OPTIONs. - FM	     */	    CTRACE(tfp, "LYHandleSELECT: Ignoring SIZE=\"%s\" for SELECT.\n",			value[HTML_SELECT_SIZE]);#endif /* NOTDEFINED */	}	if (me->inBoldH == TRUE &&	    (multiple == NO || LYSelectPopups == FALSE)) {	    HText_appendCharacter(me->text, LY_BOLD_END_CHAR);	    me->inBoldH = FALSE;	    me->needBoldH = TRUE;	}	if (me->inUnderline == TRUE &&	    (multiple == NO || LYSelectPopups == FALSE)) {	    HText_appendCharacter(me->text, LY_UNDERLINE_END_CHAR);	    me->inUnderline = FALSE;	}	if ((multiple == NO && LYSelectPopups == TRUE) &&	    (me->sp[0].tag_number == HTML_PRE || me->inPRE == TRUE ||	     !me->sp->style->freeFormat) &&	    HText_LastLineSize(me->text, FALSE) > (LYcols - 8)) {	    /*	     *	Force a newline when we're using a popup in	     *	a PRE block and are within 7 columns from the	     *	right margin.  This will allow for the '['	     *	popup designator and help avoid a wrap in the	     *	underscore placeholder for the retracted popup	     *	entry in the HText structure. - FM	     */	    HTML_put_character(me, '\n');	    me->in_word = NO;	}	LYCheckForID(me, present, value, (int)HTML_SELECT_ID);	HText_beginSelect(name, ATTR_CS_IN, multiple, size);	FREE(name);	FREE(size);	me->first_option = TRUE;    } else {	/*	 *  Handle end tag.	 */	char *ptr;	/*	 *  Make sure we had a select start tag.	 */	if (!me->inSELECT) {	    if (TRACE) {		fprintf(tfp, "Bad HTML: Unmatched SELECT end tag\n");	    } else if (!me->inBadHTML) {		HTUserMsg(BAD_HTML_USE_TRACE);		me->inBadHTML = TRUE;	    }	    return;	}	/*	 *  Set to know that we are no longer in a select tag.	 */	me->inSELECT = FALSE;	/*	 *  Clear the disable attribute.	 */	me->select_disabled = FALSE;	/*	 *  Finish the data off.	 */	HTChunkTerminate(&me->option);	/*	 *  Finish the previous option.	 */	ptr = HText_setLastOptionValue(me->text,				       me->option.data,				       me->LastOptionValue,				       LAST_ORDER,				       me->LastOptionChecked,				       me->UCLYhndl,				       ATTR_CS_IN);	FREE(me->LastOptionValue);	me->LastOptionChecked = FALSE;	if (HTCurSelectGroupType == F_CHECKBOX_TYPE ||	    LYSelectPopups == FALSE) {	    /*	     *	Start a newline after the last checkbox/button option.	     */	    LYEnsureSingleSpace(me);	} else {	    /*	     *	Output popup box with the default option to screen,	     *	but use non-breaking spaces for output.	     */	    if (ptr &&		me->sp[0].tag_number == HTML_PRE && strlen(ptr) > 6) {		/*		 *  The code inadequately handles OPTION fields in PRE tags.		 *  We'll put up a minimum of 6 characters, and if any		 *  more would exceed the wrap column, we'll ignore them.		 */		for (i = 0; i < 6; i++) {		    if (*ptr == ' ')			HText_appendCharacter(me->text, HT_NON_BREAK_SPACE);		    else			HText_appendCharacter(me->text, *ptr);		    ptr++;		}		HText_setIgnoreExcess(me->text, TRUE);	    }	    for (; ptr && *ptr != '\0'; ptr++) {		if (*ptr == ' ')		    HText_appendCharacter(me->text, HT_NON_BREAK_SPACE);		else		    HText_appendCharacter(me->text, *ptr);	    }	    /*	     *	Add end option character.	     */	    if (!me->first_option) {		HText_appendCharacter(me->text, ']');		HText_setLastChar(me->text, ']');		me->in_word = YES;	    }	    HText_setIgnoreExcess(me->text, FALSE);	}	HTChunkClear(&me->option);	if (me->Underline_Level > 0 && me->inUnderline == FALSE) {	    HText_appendCharacter(me->text, LY_UNDERLINE_START_CHAR);	    me->inUnderline = TRUE;	}	if (me->needBoldH == TRUE && me->inBoldH == FALSE) {	    HText_appendCharacter(me->text, LY_BOLD_START_CHAR);	    me->inBoldH = TRUE;	    me->needBoldH = FALSE;	}    }}