*  Find the line position of the number sign if there is one.
* Parse the "name=value" strings.
PUBLIC void read_rc NOPARAMS{    char *line_buffer = NULL;    char rcfile[LY_MAXPATH];    FILE *fp;    char *cp;    int number_sign;    char MBM_line[256];    int  MBM_counter;    char *MBM_cp2, *MBM_cp1;    int  MBM_i2;    /*     *  Make an RC file name.     */    LYAddPathToHome(rcfile, sizeof(rcfile), FNAME_LYNXRC);    /*     *  Open the RC file for reading.     */    if ((fp = fopen(rcfile, "r")) == NULL) {	return;    }    /*     *  Process the entries.     */    while (LYSafeGets(&line_buffer, fp) != NULL) {	/*	 *  Remove any trailing white space.	 */	LYTrimTrailing(line_buffer);	/*	 *  Skip any comment or blank lines.	 */	if (line_buffer[0] == '\0' || line_buffer[0] == '#')	    continue;	/*	 *  Find the line position of the number sign if there is one.	 */	if ((cp = (char *)strchr(line_buffer, '#')) == NULL)	    number_sign = 999;	else	    number_sign = cp - line_buffer;	/*	 *  File editor.	 */	if (!system_editor && FIND_KEYWORD(cp, "file_editor")) {	    cp = SkipEquals(cp);	    StrAllocCopy(editor, cp);	/*	 *  Default bookmark file.	 */	} else if (FIND_KEYWORD(cp, "bookmark_file")) {	    cp = SkipEquals(cp);	    /*	     *  Since this is the "Default Bookmark File", we save it	     *  as a globals, and as the first MBM_A_subbookmark entry.	     */	    StrAllocCopy(bookmark_page, cp);	    StrAllocCopy(BookmarkPage, cp);	    StrAllocCopy(MBM_A_subbookmark[0], cp);	    StrAllocCopy(MBM_A_subdescript[0], MULTIBOOKMARKS_DEFAULT);	/*	 *  Multiple (sub)bookmark support settings.	 */	} else if (FIND_KEYWORD(cp, "sub_bookmarks")) {	   cp = SkipEquals(cp);	   if (!strncasecomp(cp, "standard", 8)) {	      LYMultiBookmarks = TRUE;	      LYMBMAdvanced = FALSE;	   } else if (!strncasecomp(cp, "advanced", 8)) {	      LYMultiBookmarks = TRUE;	      LYMBMAdvanced = TRUE;	   } else {	      LYMultiBookmarks = FALSE;	   }	/*	 *  Multiple (sub)bookmark definitions and descriptions.	 */	} else if (FIND_KEYWORD(cp, "multi_bookmark")) {	    /*	     *  Found the root, now cycle through all the	     *	possible spaces and match specific ones.	     */	    for (MBM_counter = 1;		 MBM_counter <= MBM_V_MAXFILES; MBM_counter++) {		sprintf(MBM_line, "multi_bookmark%c", (MBM_counter + 'A'));		if (FIND_KEYWORD(cp, MBM_line)) {		    if ((MBM_cp1 = (char *)strchr(cp, '=')) == NULL) {			break;		    } else {			if ((MBM_cp2 = (char *)strchr(cp, ',')) == NULL) {			    break;			} else {			    MBM_i2 = 0;			    /*			     *  skip over the '='.			     */			    MBM_cp1++;			    while (MBM_cp1 && MBM_cp1 != MBM_cp2) {				/*				 *  Skip spaces.				 */				if (isspace(*MBM_cp1)) {				    MBM_cp1++;				    continue;				} else {				    MBM_line[MBM_i2++] = *MBM_cp1++;				}			    }			    MBM_line[MBM_i2++] = '\0';			    StrAllocCopy(MBM_A_subbookmark[MBM_counter],					 MBM_line);			    /*			     *  Now get the description ',' and ->.			     */			    MBM_cp1 = (char *)strchr(cp, ',');			    MBM_i2 = 0;			    /*			     *  Skip over the ','.			     */			    MBM_cp1++;			    /*			     *  Eat spaces in front of description.			     */			    MBM_cp1 = LYSkipBlanks(MBM_cp1);			    while (*MBM_cp1)				MBM_line[MBM_i2++] = *MBM_cp1++;			    MBM_line[MBM_i2++] = '\0';			    StrAllocCopy(MBM_A_subdescript[MBM_counter],					 MBM_line);			    break;			}		    }		}	    }	/*	 *  FTP/file sorting method.	 */	} else if (FIND_KEYWORD(cp, "file_sorting_method")) {	   cp = SkipEquals(cp);	   if (!strncasecomp(cp, "BY_FILENAME", 11))		HTfileSortMethod = FILE_BY_NAME;	   else if (!strncasecomp(cp, "BY_TYPE", 7))		HTfileSortMethod = FILE_BY_TYPE;	   else if (!strncasecomp(cp, "BY_SIZE", 7))		HTfileSortMethod = FILE_BY_SIZE;	   else if (!strncasecomp(cp, "BY_DATE", 7))		HTfileSortMethod = FILE_BY_DATE;	/*	 *  Personal mail address.	 */	} else if (FIND_KEYWORD(cp, "personal_mail_address")) {	    cp = SkipEquals(cp);	    StrAllocCopy(personal_mail_address, cp);	/*	 *  Searching type.	 */	} else if (FIND_KEYWORD(cp, "case_sensitive_searching")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "on", 2))		case_sensitive = TRUE;	    else		case_sensitive = FALSE;	/*	 *  Character set.	 */	} else if (FIND_KEYWORD(cp, "character_set")) {	    int i = 0;	    cp = SkipEquals(cp);	    i = UCGetLYhndl_byAnyName(cp); /* by MIME or full name */	    if (i < 0)		; /* do nothing here: so fallback to lynx.cfg */	    else		current_char_set = i;	/*	 *  Preferred language.	 */	} else if (FIND_KEYWORD(cp, "preferred_language")) {	    cp = SkipEquals(cp);	    StrAllocCopy(language, cp);	/*	 *  Preferred charset.	 */	} else if (FIND_KEYWORD(cp, "preferred_charset")) {	    cp = SkipEquals(cp);	    StrAllocCopy(pref_charset, cp);	/*	 *  VI keys.	 */	} else if (FIND_KEYWORD(cp, "vi_keys")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "on", 2))		vi_keys = TRUE;	    else		vi_keys = FALSE;	/*	 *  EMACS keys.	 */	} else if (FIND_KEYWORD(cp, "emacs_keys")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "on", 2))		emacs_keys = TRUE;	    else		emacs_keys=FALSE;	/*	 *  Show dot files.	 */	} else if (FIND_KEYWORD(cp, "show_dotfiles")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "on", 2))		show_dotfiles = TRUE;	    else		show_dotfiles = FALSE;	/*	 *  Show color.	 */	} else if (FIND_KEYWORD(cp, "show_color")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "always", 6)) {		LYrcShowColor = SHOW_COLOR_ALWAYS;#if defined(USE_SLANG) || defined(COLOR_CURSES)		if (LYShowColor != SHOW_COLOR_NEVER)		    LYShowColor = SHOW_COLOR_ALWAYS;#endif /* USE_SLANG || COLOR_CURSES */	    } else if (!strncasecomp(cp, "never", 5)) {		LYrcShowColor = SHOW_COLOR_NEVER;#if defined(COLOR_CURSES)		if (LYShowColor == SHOW_COLOR_ON)		    LYShowColor = SHOW_COLOR_OFF;#endif /* COLOR_CURSES */	    }	/*	 *  Select popups.	 */	} else if (FIND_KEYWORD(cp, "select_popups")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "off", 3))		LYSelectPopups = FALSE;	    else		LYSelectPopups = TRUE;	/*	 *  Show cursor.	 */	} else if (FIND_KEYWORD(cp, "show_cursor")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "off", 3))		LYShowCursor = FALSE;	    else		LYShowCursor = TRUE;	/*	 *  Keypad mode.	 */	} else if (FIND_KEYWORD(cp, "keypad_mode")) {	    cp = SkipEquals(cp);	    if (LYstrstr(cp, "LINKS_ARE_NUMBERED"))		keypad_mode = LINKS_ARE_NUMBERED;	    else if (LYstrstr(cp, "LINKS_AND_FORM_FIELDS_ARE_NUMBERED"))		keypad_mode = LINKS_AND_FORM_FIELDS_ARE_NUMBERED;	    else		keypad_mode = NUMBERS_AS_ARROWS;	/*	 *  Keyboard layout.	 */#ifdef EXP_KEYBOARD_LAYOUT	} else if (FIND_KEYWORD(cp, "kblayout")) {	    int i = 0;	    cp = SkipEquals(cp);	    for (; LYKbLayoutNames[i]; i++) {		if (!strcmp(cp, LYKbLayoutNames[i])) {		    current_layout = i;		    break;		}	    }#endif /* EXP_KEYBOARD_LAYOUT */	/*	 *  Line edit mode.	 */	} else if (FIND_KEYWORD(cp, "lineedit_mode")) {	    int i = 0;	    cp = SkipEquals(cp);	    for (; LYLineeditNames[i]; i++) {		if (!strncmp(cp, LYLineeditNames[i], strlen(cp))) {		    current_lineedit = i;		    break;		}	    }#ifdef DIRED_SUPPORT	/*	 *  Directory list style.	 */	} else if (FIND_KEYWORD(cp, "dir_list_style")) {	    cp = SkipEquals(cp);	    if (LYstrstr(cp, "FILES_FIRST") != NULL) {		dir_list_style = FILES_FIRST;	    } else if (LYstrstr(cp,"DIRECTORIES_FIRST") != NULL) {		dir_list_style = 0;	    } else {		dir_list_style = MIXED_STYLE;	    }#endif /* DIRED_SUPPORT */	/*	 *  Accept cookies from all domains?	 */	} else if (FIND_KEYWORD(cp, "accept_all_cookies")) {	    cp = SkipEquals(cp);	    if (LYstrstr(cp,"TRUE") != NULL) {		LYAcceptAllCookies = TRUE;	    } else {		LYAcceptAllCookies = FALSE;	    }	/*	 *  Accept all cookies from certain domains?	 */	} else if (FIND_KEYWORD(cp, "cookie_accept_domains")) {	    cp = SkipEquals(cp);	    cookie_domain_flag_set(cp, FLAG_ACCEPT_ALWAYS);	    if(LYCookieAcceptDomains != NULL) {		StrAllocCat(LYCookieAcceptDomains, ",");	    }	    StrAllocCat(LYCookieAcceptDomains, cp);	/*	 *  Reject all cookies from certain domains?	 */	} else if (FIND_KEYWORD(cp, "cookie_reject_domains")) {	    cp = SkipEquals(cp);	    cookie_domain_flag_set(cp, FLAG_REJECT_ALWAYS);	    if(LYCookieRejectDomains != NULL) {		StrAllocCat(LYCookieRejectDomains, ",");	    }	    StrAllocCat(LYCookieRejectDomains, cp);	/*	 *  Cookie domains to perform loose checks?	 */	} else if (FIND_KEYWORD(cp, "cookie_loose_invalid_domains")) {	    cp = SkipEquals(cp);	    StrAllocCopy(LYCookieLooseCheckDomains, cp);	    cookie_domain_flag_set(cp, FLAG_INVCHECK_LOOSE);	/*	 *  Cookie domains to perform strict checks?	 */	} else if (FIND_KEYWORD(cp, "cookie_strict_invalid_domains")) {	    cp = SkipEquals(cp);	    StrAllocCopy(LYCookieStrictCheckDomains, cp);	    cookie_domain_flag_set(cp, FLAG_INVCHECK_STRICT);	/*	 *  Cookie domains to query user over invalid cookies?	 */	} else if (FIND_KEYWORD(cp, "cookie_query_invalid_domains")) {	    cp = SkipEquals(cp);	    StrAllocCopy(LYCookieQueryCheckDomains, cp);	    cookie_domain_flag_set(cp, FLAG_INVCHECK_QUERY);#ifdef EXP_PERSISTENT_COOKIES	/*	 *  File in which to store persistent cookies.	 */	} else if (FIND_KEYWORD(cp, "cookie_file")) {	    cp = SkipEquals(cp);	    StrAllocCopy(LYCookieFile, cp);#endif /* EXP_PERSISTENT_COOKIES */	/*	 *  User mode.	 */	} else if (FIND_KEYWORD(cp, "user_mode")) {	    cp = SkipEquals(cp);	    if (LYstrstr(cp, "ADVANCED") != NULL) {		user_mode = ADVANCED_MODE;	    } else if (LYstrstr(cp,"INTERMEDIATE") != NULL) {		user_mode = INTERMEDIATE_MODE;	    } else {		user_mode = NOVICE_MODE;	    }#ifdef NOTUSED#ifdef DISP_PARTIAL	/*	 *  Partial display logic--set the threshold # of lines before	 *  Lynx redraws the screen	 */	} else if (FIND_KEYWORD(cp, "partial_thres")) {	    cp = SkipEquals(cp);	    if (atoi(cp) != 0)		partial_threshold = atoi(cp);#endif /* DISP_PARTIAL */#endif /* NOTUSED */#ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS	/*	 *  Local execution mode - all links.	 */	} else if (FIND_KEYWORD(cp, "run_all_execution_links")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "on", 2))		local_exec = TRUE;	     else		local_exec = FALSE;	/*	 *  Local execution mode - only links in local files.	 */	} else if (FIND_KEYWORD(cp, "run_execution_links_on_local_files")) {	    cp = SkipEquals(cp);	    if (!strncasecomp(cp, "on", 2))		local_exec_on_local_files = TRUE;	    else		local_exec_on_local_files=FALSE;#endif /* ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS */	} else if (FIND_KEYWORD(cp, "verbose_images")) {	   cp = SkipEquals(cp);	   if (!strncasecomp(cp, "on", 2))		verbose_img = 1;	   else if (!strncasecomp(cp, "off", 3))		verbose_img = 0;	} /* end of if */    } /* end of while */    fclose(fp);} /* big end */