diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/GridText.c | 5 | ||||
-rw-r--r-- | src/HTAlert.c | 2 | ||||
-rw-r--r-- | src/LYCurses.c | 1 | ||||
-rw-r--r-- | src/LYDownload.c | 5 | ||||
-rw-r--r-- | src/LYGlobalDefs.h | 1 | ||||
-rw-r--r-- | src/LYMain.c | 1 | ||||
-rw-r--r-- | src/LYMainLoop.c | 35 | ||||
-rw-r--r-- | src/LYOptions.c | 71 | ||||
-rw-r--r-- | src/LYOptions.h | 63 | ||||
-rw-r--r-- | src/LYReadCFG.c | 1 | ||||
-rw-r--r-- | src/LYShowInfo.c | 2 | ||||
-rw-r--r-- | src/LYUtils.c | 35 |
12 files changed, 109 insertions, 113 deletions
diff --git a/src/GridText.c b/src/GridText.c index 02986757..c9d5b5a9 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -2680,7 +2680,7 @@ PUBLIC int HText_beginAnchor ARGS3( BOOL, underline, HTChildAnchor *, anc) { - char marker[16]; + char marker[32]; TextAnchor * a = (TextAnchor *) calloc(1, sizeof(*a)); @@ -2719,6 +2719,9 @@ PUBLIC int HText_beginAnchor ARGS3( /* * If we are doing link_numbering add the link number. */ + if (verbose_links) { + HText_appendText(text, "(LINK)"); + } if ((a->number > 0) && (keypad_mode == LINKS_ARE_NUMBERED || keypad_mode == LINKS_AND_FORM_FIELDS_ARE_NUMBERED)) { diff --git a/src/HTAlert.c b/src/HTAlert.c index 42aa340f..c709361a 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -140,7 +140,7 @@ PUBLIC void HTReadProgress ARGS2( if (total < -1) strcat(line, " (Press 'z' to abort)"); } - _HTProgress(line); + HTProgress(line); } } } diff --git a/src/LYCurses.c b/src/LYCurses.c index 57d8c753..0e3e0ea9 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -535,6 +535,7 @@ PUBLIC int lynx_chg_color ARGS3( int, bg ) { + if (fg == ERR_COLOR || bg == ERR_COLOR) return -1; if (color >= 0 && color < 8) { lynx_color_cfg[color].fg = (fg > 7) ? (fg & 7) : fg; lynx_color_cfg[color].bg = (bg > 7) ? (bg & 7) : bg; diff --git a/src/LYDownload.c b/src/LYDownload.c index acf6d882..114adb16 100644 --- a/src/LYDownload.c +++ b/src/LYDownload.c @@ -619,10 +619,9 @@ PUBLIC int LYdownload_options ARGS2( <em>Downloaded link:</em> %s\n", downloaded_url); - if (!no_disk_save && !child_lynx) fprintf(fp0, "\ - <em>Suggested file name:</em> %s%s\n", - (lynx_save_space ? lynx_save_space : ""), sug_filename); + <em>Suggested file name:</em> %s\n", + sug_filename); fprintf(fp0, "\n%s options:\n", (user_mode == NOVICE_MODE) ? "Standard download" : "Download"); diff --git a/src/LYGlobalDefs.h b/src/LYGlobalDefs.h index 263ca075..92db467a 100644 --- a/src/LYGlobalDefs.h +++ b/src/LYGlobalDefs.h @@ -177,6 +177,7 @@ extern BOOLEAN vi_keys; /* TRUE to turn on vi-like key movement */ extern BOOLEAN emacs_keys; /* TRUE to turn on emacs-like key movement */ extern int keypad_mode; /* is set to either NUMBERS_AS_ARROWS * * or LINKS_ARE_NUMBERED */ +extern BOOLEAN verbose_links; /* TRUE if links are preceded by (LINK) */ extern BOOLEAN case_sensitive; /* TRUE to turn on case sensitive search */ extern BOOLEAN no_inside_telnet; /* this and following are restrictions */ extern BOOLEAN no_outside_telnet; diff --git a/src/LYMain.c b/src/LYMain.c index e749f638..25ba5b70 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -187,6 +187,7 @@ PUBLIC BOOLEAN check_mail = CHECKMAIL; PUBLIC BOOLEAN vi_keys = VI_KEYS_ALWAYS_ON; PUBLIC BOOLEAN emacs_keys = EMACS_KEYS_ALWAYS_ON; PUBLIC int keypad_mode = DEFAULT_KEYPAD_MODE; +PUBLIC BOOLEAN verbose_links = VERBOSE_LINKS; PUBLIC BOOLEAN case_sensitive = CASE_SENSITIVE_ALWAYS_ON; PUBLIC BOOLEAN telnet_ok = TRUE; PUBLIC BOOLEAN news_ok = TRUE; diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index 5d062f73..46ec32e3 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -209,7 +209,6 @@ int mainloop NOARGS BOOLEAN show_dotfiles_flag = show_dotfiles; BOOLEAN user_mode_flag = user_mode; int CurrentAssumeCharSet_flag = UCLYhndl_for_unspec; - int CurrentAssumeLocalCharSet_flag = UCLYhndl_HTFile_for_unspec; int CurrentCharSet_flag = current_char_set; int HTfileSortMethod_flag = HTfileSortMethod; #endif @@ -2024,10 +2023,8 @@ new_cmd: /* */ HTAlert(RELOADING_FORM); } - newdoc.line = ((curdoc.line > 0) ? - curdoc.line : 1); - newdoc.link = ((curdoc.link > -1) ? - curdoc.link : 0); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; #endif /* NO_ASSUME_SAME_DOC */ FREE(curdoc.address); /* so it doesn't get pushed */ #ifdef VMS @@ -2060,6 +2057,8 @@ new_cmd: /* HTuncache_current_document(); StrAllocCopy(newdoc.address, curdoc.address); FREE(curdoc.address); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; } if (historical_comments) historical_comments = FALSE; @@ -2090,6 +2089,8 @@ new_cmd: /* HTuncache_current_document(); StrAllocCopy(newdoc.address, curdoc.address); FREE(curdoc.address); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; } } if (minimal_comments) @@ -2120,6 +2121,8 @@ new_cmd: /* HTuncache_current_document(); StrAllocCopy(newdoc.address, curdoc.address); FREE(curdoc.address); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; } if (soft_dquotes) soft_dquotes = FALSE; @@ -2154,11 +2157,11 @@ new_cmd: /* FREE(curdoc.address); } #ifdef NO_ASSUME_SAME_DOC - newdoc.line=1; - newdoc.link=0; + newdoc.line = 1; + newdoc.link = 0; #else - newdoc.line = ((curdoc.line > 0) ? curdoc.line : 1); - newdoc.link = ((curdoc.link > -1) ? curdoc.link : 0); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; #endif /* NO_ASSUME_SAME_DOC */ if (New_DTD) New_DTD = NO; @@ -3736,7 +3739,6 @@ if (!LYUseFormsOptions) { !strncmp(curdoc.address, "ftp:", 4))) || CurrentCharSet_flag != current_char_set || CurrentAssumeCharSet_flag != UCLYhndl_for_unspec || - CurrentAssumeLocalCharSet_flag != UCLYhndl_HTFile_for_unspec || verbose_img_flag != verbose_img || LYRawMode_flag != LYRawMode || LYSelectPopups_flag != LYSelectPopups || @@ -3793,10 +3795,8 @@ if (!LYUseFormsOptions) { newdoc.line = 1; newdoc.link = 0; #else - newdoc.line = ((curdoc.line > 0) ? - curdoc.line : 1); - newdoc.link = ((curdoc.link > -1) ? - curdoc.link : 0); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; #endif /* NO_ASSUME_SAME_DOC */ LYforce_no_cache = TRUE; FREE(curdoc.address); /* So it doesn't get pushed. */ @@ -3807,7 +3807,6 @@ if (!LYUseFormsOptions) { HTfileSortMethod_flag = HTfileSortMethod; CurrentCharSet_flag = current_char_set; CurrentAssumeCharSet_flag = UCLYhndl_for_unspec; - CurrentAssumeLocalCharSet_flag = UCLYhndl_HTFile_for_unspec; show_dotfiles_flag = show_dotfiles; verbose_img_flag = verbose_img; LYRawMode_flag = LYRawMode; @@ -4220,10 +4219,8 @@ if (!LYUseFormsOptions) { * Seek old position, * which probably changed. */ - newdoc.line = - ((curdoc.line > 0) ? curdoc.line : 1); - newdoc.link = - ((curdoc.link > -1) ? curdoc.link : 0); + newdoc.line = curdoc.line; + newdoc.link = curdoc.link; #endif /* NO_SEEK_OLD_POSITION */ clear(); /* clear the screen */ } diff --git a/src/LYOptions.c b/src/LYOptions.c index 58202a82..fa59d8fb 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -43,8 +43,70 @@ PRIVATE int popup_choice PARAMS(( #define MAXCHOICES 10 +/* + * Values for the options menu. - FM + * + * L_foo values are the Y coordinates for the menu item. + * B_foo values are the X coordinates for the item's prompt string. + * C_foo values are the X coordinates for the item's value string. + */ +#define L_EDITOR 2 +#define L_DISPLAY 3 + +#define L_HOME 4 +#define C_MULTI 24 +#define B_BOOK 34 +#define C_DEFAULT 50 + +#define L_FTPSTYPE 5 +#define L_MAIL_ADDRESS 6 +#define L_SSEARCH 7 +#define L_LANGUAGE 8 +#define L_PREF_CHARSET 9 +#define L_ASSUME_CHARSET (L_PREF_CHARSET + 1) +#define L_CHARSET 10 +#define L_RAWMODE 11 + +#define L_COLOR L_RAWMODE +#define B_COLOR 44 +#define C_COLOR 62 + +#define L_BOOL_A 12 +#define B_VIKEYS 5 +#define C_VIKEYS 15 +#define B_EMACSKEYS 22 +#define C_EMACSKEYS 36 +#define B_SHOW_DOTFILES 44 +#define C_SHOW_DOTFILES 62 + +#define L_BOOL_B 13 +#define B_SELECT_POPUPS 5 +#define C_SELECT_POPUPS 36 +#define B_SHOW_CURSOR 44 +#define C_SHOW_CURSOR 62 + +#define L_KEYPAD 14 +#define L_LINEED 15 + +#ifdef DIRED_SUPPORT +#define L_DIRED 16 +#define L_USER_MODE 17 +#define L_USER_AGENT 18 +#define L_EXEC 19 +#else +#define L_USER_MODE 16 +#define L_USER_AGENT 17 +#define L_EXEC 18 +#endif /* DIRED_SUPPORT */ + +#define L_VERBOSE_IMAGES L_USER_MODE +#define B_VERBOSE_IMAGES 50 +#define C_VERBOSE_IMAGES (B_VERBOSE_IMAGES + 21) + + #define COL_OPTION_VALUES 36 /* display column where option values start */ +/* a kludge to add assume_charset only in ADVANCED mode... */ #define L_Bool_A (use_assume_charset ? L_BOOL_A + 1 : L_BOOL_A) #define L_Bool_B (use_assume_charset ? L_BOOL_B + 1 : L_BOOL_B) #define L_Exec (use_assume_charset ? L_EXEC + 1 : L_EXEC) @@ -56,9 +118,8 @@ PRIVATE int popup_choice PARAMS(( #define L_Dired (use_assume_charset ? L_DIRED + 1 : L_DIRED) #define L_User_Mode (use_assume_charset ? L_USER_MODE + 1 : L_USER_MODE) #define L_User_Agent (use_assume_charset ? L_USER_AGENT + 1 : L_USER_AGENT) -#endif /* !EXP_FORMS_OPTIONS */ -#ifndef EXP_FORMS_OPTIONS + PUBLIC void LYoptions NOARGS { #ifdef ALLOW_USERS_TO_CHANGE_EXEC_WITHIN_OPTIONS @@ -72,7 +133,6 @@ PUBLIC void LYoptions NOARGS char *choices[MAXCHOICES]; int CurrentCharSet = current_char_set; int CurrentAssumeCharSet = UCLYhndl_for_unspec; - int CurrentAssumeLocalCharSet = UCLYhndl_HTFile_for_unspec; int CurrentShowColor = LYShowColor; BOOLEAN CurrentRawMode = LYRawMode; BOOLEAN AddValueAccepted = FALSE; @@ -785,7 +845,6 @@ draw_options: HTMLSetUseDefaultRawMode(current_char_set, LYRawMode); HTMLSetCharacterHandling(current_char_set); CurrentAssumeCharSet = UCLYhndl_for_unspec; - CurrentAssumeLocalCharSet = UCLYhndl_HTFile_for_unspec; CurrentRawMode = LYRawMode; #if !defined(VMS) && !defined(USE_SLANG) if (!LYSelectPopups) @@ -3210,10 +3269,10 @@ static char * user_agent_string = "user_agent"; #define PutLabel(fp, text) \ fprintf(fp," %-33s: ", text) -#define PutTextInput(fp, name, value, size, disable) \ +#define PutTextInput(fp, Name, Value, Size, disable) \ fprintf(fp,\ "<input size=%d type=\"text\" name=\"%s\" value=\"%s\" %s>\n",\ - (int) size, name, value, disable) + (int) Size, Name, Value, disable) #define PutOption(fp, flag, html, name) \ fprintf(fp,"<option value=\"%s\" %s>%s\n", html, SELECTED(flag), name) diff --git a/src/LYOptions.h b/src/LYOptions.h index ccbc5b1d..2752bde8 100644 --- a/src/LYOptions.h +++ b/src/LYOptions.h @@ -3,7 +3,7 @@ #include <LYStructs.h> -extern BOOLEAN term_options; +extern BOOLEAN term_options; /* for LYgetstr() */ extern void edit_bookmarks NOPARAMS; @@ -12,67 +12,6 @@ extern int gen_options PARAMS((char **newfile)); #ifndef EXP_FORMS_OPTIONS extern void LYoptions NOPARAMS; - -/* - * Values for the options menu. - FM - * - * L_foo values are the Y coordinates for the menu item. - * B_foo values are the X coordinates for the item's prompt string. - * C_foo values are the X coordinates for the item's value string. - */ -#define L_EDITOR 2 -#define L_DISPLAY 3 - -#define L_HOME 4 -#define C_MULTI 24 -#define B_BOOK 34 -#define C_DEFAULT 50 - -#define L_FTPSTYPE 5 -#define L_MAIL_ADDRESS 6 -#define L_SSEARCH 7 -#define L_LANGUAGE 8 -#define L_PREF_CHARSET 9 -#define L_ASSUME_CHARSET (L_PREF_CHARSET + 1) -#define L_CHARSET 10 -#define L_RAWMODE 11 - -#define L_COLOR L_RAWMODE -#define B_COLOR 44 -#define C_COLOR 62 - -#define L_BOOL_A 12 -#define B_VIKEYS 5 -#define C_VIKEYS 15 -#define B_EMACSKEYS 22 -#define C_EMACSKEYS 36 -#define B_SHOW_DOTFILES 44 -#define C_SHOW_DOTFILES 62 - -#define L_BOOL_B 13 -#define B_SELECT_POPUPS 5 -#define C_SELECT_POPUPS 36 -#define B_SHOW_CURSOR 44 -#define C_SHOW_CURSOR 62 - -#define L_KEYPAD 14 -#define L_LINEED 15 - -#ifdef DIRED_SUPPORT -#define L_DIRED 16 -#define L_USER_MODE 17 -#define L_USER_AGENT 18 -#define L_EXEC 19 -#else -#define L_USER_MODE 16 -#define L_USER_AGENT 17 -#define L_EXEC 18 -#endif /* DIRED_SUPPORT */ - -#define L_VERBOSE_IMAGES L_USER_MODE -#define B_VERBOSE_IMAGES 50 -#define C_VERBOSE_IMAGES (B_VERBOSE_IMAGES + 21) - #endif /* !EXP_FORMS_OPTIONS */ #endif /* LYOPTIONS_H */ diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index d1a48146..551f6219 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -950,6 +950,7 @@ static Config_Type Config_Table [] = #endif PARSE_SET("use_select_popups", CONF_BOOL, LYSelectPopups), PARSE_SET("verbose_images", CONF_BOOL, verbose_img), + PARSE_SET("verbose_links", CONF_BOOL, verbose_links), PARSE_SET("vi_keys_always_on", CONF_BOOL, vi_keys), PARSE_FUN("viewer", CONF_FUN, viewer_fun), PARSE_ENV("wais_proxy", CONF_ENV, 0 ), diff --git a/src/LYShowInfo.c b/src/LYShowInfo.c index 32d31a6c..ca01bf9e 100644 --- a/src/LYShowInfo.c +++ b/src/LYShowInfo.c @@ -26,7 +26,7 @@ #ifdef HAVE_CONFIG_H #define HAVE_CFG_DEFS_H -#define PutDefs(table, n) fprintf(fp0, "%-35s %s\n", table[n].name, table[n].value) +#define PutDefs(table, N) fprintf(fp0, "%-35s %s\n", table[N].name, table[N].value) /* * Compile-time definitions info, returns local url diff --git a/src/LYUtils.c b/src/LYUtils.c index 7808d659..ff01e020 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -5434,7 +5434,7 @@ PRIVATE BOOL IsOurFile ARGS1(char *, name) && S_ISREG(data.st_mode) && data.st_nlink == 1 && data.st_uid == getuid()) { - int linked = 0; + int linked = FALSE; #if HAVE_LSTAT char *path = 0; char *leaf; @@ -5452,27 +5452,22 @@ PRIVATE BOOL IsOurFile ARGS1(char *, name) * to one of the real user's files. */ if (S_ISLNK(data.st_mode)) { - if (!linked) { - linked++; - } else { /* a link-to-link is a little hard to digest */ - break; - } + linked = TRUE; /* could be link-to-link; doesn't matter */ } else if (S_ISDIR(data.st_mode)) { if (linked) { - if (--linked == 0) { - /* - * We assume that a properly-configured system has the - * unwritable directories owned by root. This is not - * necessarily so (bin, news, etc., may), but the only - * uid we can count on is 0. It would be nice to add a - * check for the gid also, but that wouldn't be - * portable. - */ - if (data.st_uid != 0 - || data.st_mode & S_IWOTH) { - linked = 1; - break; - } + linked = FALSE; + /* + * We assume that a properly-configured system has the + * unwritable directories owned by root. This is not + * necessarily so (bin, news, etc., may), but the only + * uid we can count on is 0. It would be nice to add a + * check for the gid also, but that wouldn't be + * portable. + */ + if (data.st_uid != 0 + || data.st_mode & S_IWOTH) { + linked = TRUE; /* force an error-return */ + break; } } } else if (linked) { |