static BOOLEAN always = TRUE; static struct { CONST char *name; BOOLEAN *flag; } table[] = { { STR_FILE_URL,		&no_file_url }, { STR_FILE_URL,		&no_goto_file }, { STR_LYNXEXEC,		&no_goto_lynxexec }, { STR_LYNXPROG,		&no_goto_lynxprog }, { STR_LYNXCGI,		&no_goto_lynxcgi }, { STR_CSO_URL,		&no_goto_cso }, { STR_FINGER_URL,	&no_goto_finger }, { STR_FTP_URL,		&no_goto_ftp }, { STR_GOPHER_URL,	&no_goto_gopher }, { STR_HTTP_URL,		&no_goto_http }, { STR_HTTPS_URL,	&no_goto_https }, { STR_MAILTO_URL,	&no_goto_mailto }, { STR_RLOGIN_URL,	&no_goto_rlogin }, { STR_TELNET_URL,	&no_goto_telnet }, { STR_TN3270_URL,	&no_goto_tn3270 }, { STR_WAIS_URL,		&no_goto_wais }, #ifndef DISABLE_BIBP { STR_BIBP_URL,		&no_goto_bibp }, #endif #ifndef DISABLE_NEWS { STR_NEWS_URL,		&no_goto_news }, { STR_NNTP_URL,		&no_goto_nntp }, { STR_SNEWS_URL,	&no_goto_snews }, #endif #ifdef EXEC_LINKS { STR_LYNXEXEC,		&local_exec_on_local_files }, { STR_LYNXPROG,		&local_exec_on_local_files }, #endif  { STR_LYNXCFG,		&no_goto_configinfo }, { STR_LYNXCFLAGS,	&no_goto_configinfo }, { STR_LYNXCOOKIE,	&always }, { STR_LYNXDIRED,	&always }, { STR_LYNXDOWNLOAD,	&always }, { STR_LYNXOPTIONS,	&always }, { STR_LYNXPRINT,	&always }, }; unsigned n; BOOLEAN found = FALSE;
PRIVATE void do_check_goto_URL ARGS3(    char *,	user_input_buffer,    char **,	old_user_input,    BOOLEAN *,	force_load){    static BOOLEAN always = TRUE;    static struct {	CONST char *name;	BOOLEAN *flag;    } table[] = {	{ STR_FILE_URL,		&no_file_url },	{ STR_FILE_URL,		&no_goto_file },	{ STR_LYNXEXEC,		&no_goto_lynxexec },	{ STR_LYNXPROG,		&no_goto_lynxprog },	{ STR_LYNXCGI,		&no_goto_lynxcgi },	{ STR_CSO_URL,		&no_goto_cso },	{ STR_FINGER_URL,	&no_goto_finger },	{ STR_FTP_URL,		&no_goto_ftp },	{ STR_GOPHER_URL,	&no_goto_gopher },	{ STR_HTTP_URL,		&no_goto_http },	{ STR_HTTPS_URL,	&no_goto_https },	{ STR_MAILTO_URL,	&no_goto_mailto },	{ STR_RLOGIN_URL,	&no_goto_rlogin },	{ STR_TELNET_URL,	&no_goto_telnet },	{ STR_TN3270_URL,	&no_goto_tn3270 },	{ STR_WAIS_URL,		&no_goto_wais },#ifndef DISABLE_BIBP	{ STR_BIBP_URL,		&no_goto_bibp },#endif#ifndef DISABLE_NEWS	{ STR_NEWS_URL,		&no_goto_news },	{ STR_NNTP_URL,		&no_goto_nntp },	{ STR_SNEWS_URL,	&no_goto_snews },#endif#ifdef EXEC_LINKS	{ STR_LYNXEXEC,		&local_exec_on_local_files },	{ STR_LYNXPROG,		&local_exec_on_local_files },#endif /* EXEC_LINKS */	{ STR_LYNXCFG,		&no_goto_configinfo },	{ STR_LYNXCFLAGS,	&no_goto_configinfo },	{ STR_LYNXCOOKIE,	&always },	{ STR_LYNXDIRED,	&always },	{ STR_LYNXDOWNLOAD,	&always },	{ STR_LYNXOPTIONS,	&always },	{ STR_LYNXPRINT,	&always },    };    unsigned n;    BOOLEAN found = FALSE;    /* allow going to anchors*/    if (*user_input_buffer == '#' ) {	if ( user_input_buffer[1] &&	     HTFindPoundSelector(user_input_buffer+1) ) {	     /* HTFindPoundSelector will initialize www_search_result,		so we do nothing else. */	    HTAddGotoURL(user_input_buffer);	    trimPoundSelector(curdoc.address);	    StrAllocCat(curdoc.address, user_input_buffer);	}    } else {	/*	 * If it's not a URL then make it one.	 */	StrAllocCopy(*old_user_input, user_input_buffer);	LYEnsureAbsoluteURL(old_user_input, "", TRUE);	sprintf(user_input_buffer, "%.*s",		(int)(MAX_LINE - 1), *old_user_input);	FREE(*old_user_input);	for (n = 0; n < TABLESIZE(table); n++) {	    if (*(table[n].flag)	     && !strncmp(user_input_buffer, table[n].name, strlen(table[n].name))) {		found = TRUE;		HTUserMsg2(GOTO_XXXX_DISALLOWED, table[n].name);		break;	    }	}	if (found) {	    ;	} else if (LYValidate &&		   !isHTTP_URL(user_input_buffer) &&		   !isHTTPS_URL(user_input_buffer)) {	    HTUserMsg(GOTO_NON_HTTP_DISALLOWED);	} else {	    set_address(&newdoc, user_input_buffer);	    newdoc.isHEAD = FALSE;	    /*	     *  Might be an anchor in the same doc from a POST	     *  form.  If so, dont't free the content. -- FM	     */	    if (are_different(&curdoc, &newdoc)) {		/*		 * Make a name for this new URL.		 */		StrAllocCopy(newdoc.title, gettext("A URL specified by the user"));		LYFreePostData(&newdoc);		FREE(newdoc.bookmark);		newdoc.safe = FALSE;		newdoc.internal_link = FALSE;		*force_load = TRUE;#ifdef DIRED_SUPPORT		if (lynx_edit_mode) {		    DIRED_UNCACHE_2;		}#endif /* DIRED_SUPPORT */	    }	    LYUserSpecifiedURL = TRUE;	    HTAddGotoURL(newdoc.address);	}    }}