diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/HTAlert.c | 4 | ||||
-rw-r--r-- | src/HTFWriter.c | 2 | ||||
-rw-r--r-- | src/HTInit.c | 2 | ||||
-rw-r--r-- | src/HTML.c | 2 | ||||
-rw-r--r-- | src/LYCharVals.h | 28 | ||||
-rw-r--r-- | src/LYClean.c | 2 | ||||
-rw-r--r-- | src/LYCookie.c | 2 | ||||
-rw-r--r-- | src/LYCurses.c | 6 | ||||
-rw-r--r-- | src/LYCurses.h | 2 | ||||
-rw-r--r-- | src/LYLeaks.c | 10 | ||||
-rw-r--r-- | src/LYLocal.c | 2 | ||||
-rw-r--r-- | src/LYMail.c | 2 | ||||
-rw-r--r-- | src/LYMain.c | 39 | ||||
-rw-r--r-- | src/LYMainLoop.c | 32 | ||||
-rw-r--r-- | src/LYOptions.c | 6 | ||||
-rw-r--r-- | src/LYPrettySrc.c | 6 | ||||
-rw-r--r-- | src/LYReadCFG.c | 15 | ||||
-rw-r--r-- | src/LYStrings.c | 2 | ||||
-rw-r--r-- | src/LYStyle.c | 6 | ||||
-rw-r--r-- | src/LYTraversal.c | 2 | ||||
-rw-r--r-- | src/LYUtils.c | 2 | ||||
-rw-r--r-- | src/LYUtils.h | 3 |
22 files changed, 93 insertions, 84 deletions
diff --git a/src/HTAlert.c b/src/HTAlert.c index 132a34a7..e51d07e9 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -145,9 +145,9 @@ PRIVATE char *sprint_bytes ARGS3( } u = kbunits; - if ((LYTransferRate == rateBYTES) && (n >= 10 * kb_units)) + if ((LYTransferRate == rateKB) && (n >= 10 * kb_units)) sprintf(s, "%ld", n/kb_units); - else if ((LYTransferRate == rateBYTES) && (n >= kb_units)) + else if ((LYTransferRate == rateKB) && (n >= kb_units)) sprintf(s, "%.2g", ((double)n)/kb_units); else { sprintf(s, "%ld", n); diff --git a/src/HTFWriter.c b/src/HTFWriter.c index 0ac88e8e..41cd9310 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -434,7 +434,7 @@ PRIVATE void HTFWriter_free ARGS1(HTStream *, me) if (persistent_cookies) LYStoreCookies(LYCookieSaveFile); #endif /* EXP_PERSISTENT_COOKIES */ - exit_immediately(0); + exit_immediately(EXIT_SUCCESS); } FREE(me); diff --git a/src/HTInit.c b/src/HTInit.c index 9ec737b0..e3e734e4 100644 --- a/src/HTInit.c +++ b/src/HTInit.c @@ -644,7 +644,7 @@ PRIVATE int ExitWithError ARGS1( { if (txt) fprintf(tfp, "Lynx: %s\n", txt); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); return(-1); } diff --git a/src/HTML.c b/src/HTML.c index 0fbce76f..78638520 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -8190,7 +8190,7 @@ PUBLIC HTStructured* HTML_new ARGS3( return HTMLGenerator(intermediate); fprintf(stderr, "\n** Internal error: can't parse HTML to %s\n", HTAtom_name(format_out)); - exit_immediately (-1); + exit_immediately (EXIT_FAILURE); } me = (HTStructured*) calloc(sizeof(*me),1); diff --git a/src/LYCharVals.h b/src/LYCharVals.h index 18da1245..4d0a9410 100644 --- a/src/LYCharVals.h +++ b/src/LYCharVals.h @@ -11,19 +11,23 @@ */ #ifndef CH_ESC #ifdef EBCDIC -#define CH_DEL 0x07 -#define CH_ESC 0x27 -#define CH_ESC_PAR 0x27 -#define CH_HICTL 0x3f -#define CH_NBSP 0x41 -#define CH_SHY 0xca +#define CH_DEL 0x07 +#define CH_ESC 0x27 +#define CH_ESC_PAR 0x27 +#define CH_HICTL 0x3f +#define CH_NBSP 0x41 +#define CH_SHY 0xca +#define LYCharINTERRUPT1 0x03 /* Control-C */ +#define LYCharINTERRUPT2 0x2f /* Control-G */ #else /* EBCDIC */ -#define CH_ESC 0033 -#define CH_DEL 0177 -#define CH_ESC_PAR 0233 -#define CH_HICTL 0237 -#define CH_NBSP 0240 -#define CH_SHY 0255 +#define CH_ESC 0033 +#define CH_DEL 0177 +#define CH_ESC_PAR 0233 +#define CH_HICTL 0237 +#define CH_NBSP 0240 +#define CH_SHY 0255 +#define LYCharINTERRUPT1 0003 /* Control-C */ +#define LYCharINTERRUPT2 0007 /* Control-G */ #endif /* EBCDIC */ #endif /* CH_ESC */ diff --git a/src/LYClean.c b/src/LYClean.c index 89270923..2266c952 100644 --- a/src/LYClean.c +++ b/src/LYClean.c @@ -127,7 +127,7 @@ PUBLIC void cleanup_sig ARGS1( (void) signal(SIGTSTP, SIG_DFL); #endif /* SIGTSTP */ if (sig != 0) { - exit(0); + exit(EXIT_SUCCESS); } } diff --git a/src/LYCookie.c b/src/LYCookie.c index 400b3ebb..223587ad 100644 --- a/src/LYCookie.c +++ b/src/LYCookie.c @@ -2755,7 +2755,7 @@ PUBLIC void cookie_domain_flag_set ARGS2( if (str == NULL) { HTAlwaysAlert(gettext("Internal"), gettext("cookie_domain_flag_set error, aborting program")); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } /* diff --git a/src/LYCurses.c b/src/LYCurses.c index 7cddbc34..0b51206b 100644 --- a/src/LYCurses.c +++ b/src/LYCurses.c @@ -696,7 +696,7 @@ PUBLIC void start_curses NOARGS if (slinit == 0) { #if defined(USE_KEYMAPS) if (-1 == lynx_initialize_keymaps ()) - exit (-1); + exit (EXIT_FAILURE); #else SLtt_get_terminfo(); #endif @@ -839,7 +839,7 @@ PUBLIC void start_curses NOARGS if (!(LYscreen=newterm(NULL,stdout,stdin))) { /* start curses */ fprintf(tfp, "%s\n", gettext("Terminal initialisation failed - unknown terminal type?")); - exit_immediately (-1); + exit_immediately (EXIT_FAILURE); } lynx_called_initscr = TRUE; #if defined(SIGWINCH) && defined(NCURSES_VERSION) @@ -857,7 +857,7 @@ PUBLIC void start_curses NOARGS if (-1 == lynx_initialize_keymaps ()) { endwin(); - exit (-1); + exit (EXIT_FAILURE); } #endif diff --git a/src/LYCurses.h b/src/LYCurses.h index f7be0924..88b5786c 100644 --- a/src/LYCurses.h +++ b/src/LYCurses.h @@ -538,7 +538,7 @@ extern void lynx_stop_all_colors NOPARAMS; * have setmode. */ #if defined(_WINDOWS) || defined(DJGPP) || defined(__EMX__) || defined(WIN_EX) -#define SetOutputMode(mode) setmode(fileno(stdout), mode) +#define SetOutputMode(mode) fflush(stdout), setmode(fileno(stdout), mode) #else #define SetOutputMode(mode) /* nothing */ #endif diff --git a/src/LYLeaks.c b/src/LYLeaks.c index fe0cb852..87a11666 100644 --- a/src/LYLeaks.c +++ b/src/LYLeaks.c @@ -418,7 +418,7 @@ PUBLIC void *LYLeakRealloc ARGS4( sizeof(AllocationList)); if (ALp_new == NULL) { - exit(-1); + exit(EXIT_FAILURE); } /* @@ -435,7 +435,7 @@ PUBLIC void *LYLeakRealloc ARGS4( * Exit. */ AddToList(ALp_new); - exit(-1); + exit(EXIT_FAILURE); } /* @@ -551,7 +551,7 @@ PUBLIC void LYLeakFree ARGS3( sizeof(AllocationList)); if (ALp_new == NULL) { - exit(-1); + exit(EXIT_FAILURE); } /* @@ -726,7 +726,7 @@ PRIVATE char * LYLeakSAVsprintf ARGS6( sizeof(AllocationList)); if (ALp_new == NULL) { - exit(-1); + exit(EXIT_FAILURE); } /* @@ -743,7 +743,7 @@ PRIVATE char * LYLeakSAVsprintf ARGS6( * Exit. */ AddToList(ALp_new); - exit(-1); + exit(EXIT_FAILURE); } old_cp_File = ALp_old->SL_memory.cp_FileName; diff --git a/src/LYLocal.c b/src/LYLocal.c index defb7044..64994ccf 100644 --- a/src/LYLocal.c +++ b/src/LYLocal.c @@ -2401,7 +2401,7 @@ PRIVATE int LYExecv ARGS3( #else execv(path, argv); #endif - exit(-1); /* execv failed, give wait() something to look at */ + exit(EXIT_FAILURE); /* execv failed, give wait() something to look at */ default: /* parent */ #if !HAVE_WAITPID while (wait(&wstatus) != pid) diff --git a/src/LYMail.c b/src/LYMail.c index d1a06c51..0bd3c561 100644 --- a/src/LYMail.c +++ b/src/LYMail.c @@ -1053,7 +1053,7 @@ PUBLIC void mailmsg ARGS4( if ((ofp = LYAppendToTxtFile(TRAVERSE_ERRORS)) == NULL) { if ((ofp = LYNewTxtFile(TRAVERSE_ERRORS)) == NULL) { perror(NOOPEN_TRAV_ERR_FILE); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } } diff --git a/src/LYMain.c b/src/LYMain.c index 11b2b916..72a6e502 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -428,7 +428,7 @@ BOOLEAN persistent_cookies = FALSE; /* disabled by default! */ PUBLIC char *LYCookieFile = NULL; /* cookie read file */ PUBLIC char *LYCookieSaveFile = NULL; /* cookie save file */ #endif /* EXP_PERSISTENT_COOKIES */ -PUBLIC int LYTransferRate = rateBYTES; +PUBLIC int LYTransferRate = rateKB; PUBLIC char *XLoadImageCommand = NULL; /* Default image viewer for X */ PUBLIC BOOLEAN LYNoISMAPifUSEMAP = FALSE; /* Omit ISMAP link if MAP present? */ PUBLIC int LYHiddenLinks = HIDDENLINKS_SEPARATE; /* Show hidden links? */ @@ -835,6 +835,7 @@ PUBLIC int main ARGS2( char *temp = NULL; char *cp; FILE *fp; + struct stat dir_info; char filename[LY_MAXPATH]; BOOL LYGetStdinArgs = FALSE; #ifdef _WINDOWS @@ -882,7 +883,7 @@ PUBLIC int main ARGS2( #if defined(__CYGWIN__) && defined(DOSPATH) if (strcmp(ttyname(fileno(stdout)), "/dev/conout") != 0) { printf("please \"$CYGWIN=notty\"\n"); - exit(0); + exit(EXIT_SUCCESS); } #endif @@ -1053,7 +1054,7 @@ PUBLIC int main ARGS2( #else { printf(gettext("You MUST define a valid TMP or TEMP area!\n")); - exit(-1); + exit(EXIT_FAILURE); } #endif @@ -1095,6 +1096,14 @@ PUBLIC int main ARGS2( #else LYAddPathSep(&lynx_temp_space); #endif /* VMS */ + if ((HTStat(lynx_temp_space, &dir_info) < 0 + && mkdir(lynx_temp_space, 0700) < 0) + || !S_ISDIR(dir_info.st_mode)) { + fprintf(stderr, "%s: %s\n", + lynx_temp_space, + gettext("No such directory")); + exit_immediately(EXIT_FAILURE); + } #ifdef VMS #ifdef CSWING_PATH @@ -1308,7 +1317,7 @@ PUBLIC int main ARGS2( if (!LYCanReadFile(lynx_cfg_file)) { fprintf(stderr, gettext("\nConfiguration file %s is not available.\n\n"), lynx_cfg_file); - exit(-1); + exit(EXIT_FAILURE); } /* @@ -1317,7 +1326,7 @@ PUBLIC int main ARGS2( */ if (!LYCharSetsDeclared()) { fprintf(stderr, gettext("\nLynx character sets not declared.\n\n")); - exit(-1); + exit(EXIT_FAILURE); } /* * (**) in Lynx, UCLYhndl_HTFile_for_unspec and UCLYhndl_for_unrec may be @@ -1341,7 +1350,7 @@ PUBLIC int main ARGS2( */ if (!LYEditmapDeclared()) { fprintf(stderr, gettext("\nLynx edit map not declared.\n\n")); - exit(-1); + exit(EXIT_FAILURE); } #if defined(USE_HASH) @@ -1632,7 +1641,7 @@ PUBLIC int main ARGS2( #ifdef SH_EX if (show_cfg) { cleanup(); - exit(0); + exit(EXIT_SUCCESS); } #endif @@ -1809,7 +1818,7 @@ PUBLIC int main ARGS2( fprintf(stderr, "The '-head' switch is for http HEAD requests and cannot be used for\n'%s'.\n", startfile); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } /* @@ -1819,7 +1828,7 @@ PUBLIC int main ARGS2( fprintf(stderr, "The '-mime_header' switch is for http URLs and cannot be used for\n'%s'.\n", startfile); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } /* @@ -1829,7 +1838,7 @@ PUBLIC int main ARGS2( fprintf(stderr, "The '-traversal' switch is for http URLs and cannot be used for\n'%s'.\n", startfile); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } /* @@ -2864,12 +2873,12 @@ PRIVATE int restrictions_fun ARGS1( for (n = 0; n < TABLESIZE(Usage); n++) printf("%s\n", Usage[n]); SetOutputMode( O_BINARY ); - exit(0); + exit(EXIT_SUCCESS); } else if (*next_arg == '?') { SetOutputMode( O_TEXT ); print_restrictions_to_fd(stdout); SetOutputMode( O_BINARY ); - exit(0); + exit(EXIT_SUCCESS); } else { parse_restrictions(next_arg); } @@ -2958,7 +2967,7 @@ PRIVATE int version_fun ARGS1( SetOutputMode( O_BINARY ); - exit(0); + exit(EXIT_SUCCESS); /* NOT REACHED */ return 0; } @@ -3966,7 +3975,7 @@ Lynx now exiting with signal: %d\r\n\r\n", sig); * Exit and possibly dump core. */ if (LYNoCore) { - exit(-1); + exit(EXIT_FAILURE); } abort(); @@ -3978,7 +3987,7 @@ Lynx now exiting with signal: %d\r\n\r\n", sig); /* * Exit without dumping core. */ - exit(0); + exit(EXIT_SUCCESS); } } #endif /* !VMS */ diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index bfe07c5f..aff86805 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -269,7 +269,7 @@ PRIVATE void TracelogOpenFailed NOARGS HTUserMsg(TRACELOG_OPEN_FAILED); } else { fprintf(stderr, "%s\n", TRACELOG_OPEN_FAILED); - exit(-1); + exit(EXIT_FAILURE); } } @@ -885,7 +885,7 @@ PRIVATE int DoTraversal ARGS2( (nhist <= 0 )) { if (!dump_output_immediately) { cleanup(); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } return(-1); } @@ -914,7 +914,7 @@ PRIVATE int DoTraversal ARGS2( (nhist <= 0 )) { if (!dump_output_immediately) { cleanup(); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } return(-1); } @@ -5581,7 +5581,7 @@ try_again: if ((ofp = LYAppendToTxtFile(TRAVERSE_ERRORS)) == NULL) { if ((ofp = LYNewTxtFile(TRAVERSE_ERRORS)) == NULL) { perror(NOOPEN_TRAV_ERR_FILE); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } } if (nhist > 0) { @@ -5612,7 +5612,7 @@ try_again: * If nhist = 0 then it must be the first file. */ exit_immediately_with_error_message(NOT_FOUND, first_file); - return(-1); + return(EXIT_FAILURE); } /* FALLTHRU */ @@ -5687,7 +5687,7 @@ try_again: goto try_again; } else { exit_immediately_with_error_message(NULLFILE, first_file); - return(-1); + return(EXIT_FAILURE); } } @@ -5821,7 +5821,7 @@ try_again: FREE(temp); if (LYValidate) { HTAlert(BOOKMARKS_DISABLED); - return(-1); + return(EXIT_FAILURE); } if ((temp = HTParse(newdoc.address, "", PARSE_ACCESS+PARSE_HOST+PARSE_PUNCTUATION))) { @@ -6020,7 +6020,7 @@ try_again: } else { print_wwwfile_to_fd(stdout, FALSE); } - return(0); + return(EXIT_SUCCESS); } /* @@ -6483,9 +6483,9 @@ try_again: printf( gettext("Fatal error - could not open output file %s\n"),cfile); if (!dump_output_immediately) { - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } - return(-1); + return(EXIT_FAILURE); } } } else { @@ -6742,7 +6742,7 @@ new_keyboard_input: */ if (traversal) { if ((c = DoTraversal(c, &crawl_ok)) < 0) - return (-1); + return (EXIT_FAILURE); } /* traversal */ #ifdef WIN_EX @@ -6873,11 +6873,11 @@ new_cmd: /* case LYK_QUIT: /* quit */ if (handle_LYK_QUIT()) - return(0); + return(EXIT_SUCCESS); break; case LYK_ABORT: /* don't ask the user about quitting */ - return(0); + return(EXIT_SUCCESS); case LYK_NEXT_PAGE: /* next page */ handle_LYK_NEXT_PAGE(&old_c, real_c); @@ -7028,7 +7028,7 @@ new_cmd: /* case LYK_PREV_DOC: /* back up a level */ switch (handle_PREV_DOC(&cmd, &old_c, real_c)) { case 1: - return(0); + return(EXIT_SUCCESS); case 2: goto new_cmd; } @@ -7681,9 +7681,9 @@ PRIVATE void exit_immediately_with_error_message ARGS2( FREE(buf); if (!dump_output_immediately) { - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } - /* else: return(-1) in mainloop */ + /* else: return(EXIT_FAILURE) in mainloop */ } diff --git a/src/LYOptions.c b/src/LYOptions.c index ffc62382..509f7420 100644 --- a/src/LYOptions.c +++ b/src/LYOptions.c @@ -2334,16 +2334,16 @@ static OptValues ftp_sort_values[] = { { FILE_BY_DATE, "By Date", "ftp_by_date" }, { 0, 0, 0 }}; -#ifdef EXP_READPROGRESS static char * show_rate_string = "show_rate"; static OptValues rate_values[] = { { rateOFF, "Do not show rate", "rate_off" }, { rateBYTES, "Show Bytes/sec rate", "rate_bytes" }, { rateKB, "Show KB/sec rate", "rate_kb" }, +#ifdef EXP_READPROGRESS { rateEtaBYTES, "Show Bytes/sec, ETA", "rate_eta_bytes" }, { rateEtaKB, "Show KB/sec, ETA", "rate_eta_kb" }, +#endif { 0, 0, 0 }}; -#endif /* EXP_READPROGRESS */ /* * Headers transferred to remote server @@ -2901,12 +2901,10 @@ PUBLIC int postoptions ARGS1( } /* Show Transfer Rate: enumerated value */ -#ifdef EXP_READPROGRESS if (!strcmp(data[i].tag, show_rate_string) && GetOptValues(rate_values, data[i].value, &code)) { LYTransferRate = code; } -#endif /* Preferred Document Character Set: INPUT */ if (!strcmp(data[i].tag, preferred_doc_char_string)) { diff --git a/src/LYPrettySrc.c b/src/LYPrettySrc.c index 97e4c67e..36b358d8 100644 --- a/src/LYPrettySrc.c +++ b/src/LYPrettySrc.c @@ -101,7 +101,7 @@ PRIVATE void append_close_tag ARGS3( if (idx == -1) { fprintf(stderr, "internal error: previous check didn't find bad HTML tag %s", tagname); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } subj = typecalloc(HT_tagspec); @@ -348,11 +348,11 @@ PUBLIC void HTMLSRC_init_caches ARGS1( *p = '\0'; if (html_src_parse_tagspec(buf, i, FALSE, TRUE) && !dont_exit ) { fprintf(stderr, "internal error while caching 1st tagspec of %d lexeme", i); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } if (html_src_parse_tagspec( p ? p+1 : NULL , i, FALSE, FALSE) && !dont_exit) { fprintf(stderr, "internal error while caching 2nd tagspec of %d lexeme", i); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } } } diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 625b4a1c..df410147 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -425,7 +425,7 @@ The special strings 'nocolor' or 'default', or\n") Color_Strings[i + 2], Color_Strings[i + 3]); } fprintf (stderr, "%s\n%s\n", gettext("Offending line:"), error_line); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } /* @@ -944,7 +944,7 @@ static int cern_rulesfile_fun ARGS1( "Lynx: cannot start, CERN rules file %s is not available\n" ), (rulesfile2 && *rulesfile2) ? rulesfile2 : gettext("(no name)")); - exit_immediately(69); /* EX_UNAVAILABLE in sysexits.h */ + exit_immediately(EXIT_FAILURE); return 0; /* though redundant, for compiler-warnings */ } #endif /* NO_RULES */ @@ -1109,7 +1109,6 @@ static int system_editor_fun ARGS1( return 0; } -#ifdef EXP_READPROGRESS static int transfer_rate_fun ARGS1( char *, value) { @@ -1119,14 +1118,16 @@ static int transfer_rate_fun ARGS1( { "TRUE", rateKB }, { "BYTES", rateBYTES }, { "FALSE", rateBYTES }, +#ifdef EXP_READPROGRESS { "KB,ETA", rateEtaKB }, { "BYTES,ETA", rateEtaBYTES }, +#endif { NULL, -1 }, }; config_enum(table, value, &LYTransferRate); return 0; } -#endif + static int viewer_fun ARGS1( char *, value) { @@ -1277,7 +1278,7 @@ static void html_src_bad_syntax ARGS2( HTSprintf0(&buf,"HTMLSRC_%s", option_name); LYUpperCase(buf); fprintf(stderr,"Bad syntax in TAGSPEC %s:%s\n", buf, value); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } @@ -1584,9 +1585,7 @@ static Config_Type Config_Table [] = PARSE_SET("seek_frag_map_in_cur", CONF_BOOL, &LYSeekFragMAPinCur), PARSE_SET("set_cookies", CONF_BOOL, &LYSetCookies), PARSE_SET("show_cursor", CONF_BOOL, &LYShowCursor), -#ifdef EXP_READPROGRESS PARSE_SET("show_kb_rate", CONF_FUN, transfer_rate_fun), -#endif PARSE_ENV("snews_proxy", CONF_ENV, 0 ), PARSE_ENV("snewspost_proxy", CONF_ENV, 0 ), PARSE_ENV("snewsreply_proxy", CONF_ENV, 0 ), @@ -1755,7 +1754,7 @@ PRIVATE void do_read_cfg ARGS5( nesting_level - 1); fprintf(stderr,gettext("Last attempted include was '%s',\n"), cfg_filename); fprintf(stderr,gettext("included from '%s'.\n"), parent_filename); - exit(-1); + exit(EXIT_FAILURE); } /* * Locate and open the file. diff --git a/src/LYStrings.c b/src/LYStrings.c index b6e1e387..89d0fd95 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -1661,7 +1661,7 @@ re_read: #endif /* USE_GETCHAR */ cleanup(); - exit_immediately(0); + exit_immediately(EXIT_SUCCESS); } #endif /* USE_SLANG */ diff --git a/src/LYStyle.c b/src/LYStyle.c index 63852d0e..4924b2a0 100644 --- a/src/LYStyle.c +++ b/src/LYStyle.c @@ -1,6 +1,6 @@ /* character level styles for Lynx * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-) - * @Id: LYStyle.c 1.39 Wed, 25 Oct 2000 09:35:28 -0700 dickey @ + * @Id: LYStyle.c 1.40 Thu, 21 Dec 2000 18:44:11 -0800 dickey @ */ #include <HTUtils.h> #include <HTML.h> @@ -208,7 +208,7 @@ The line must be of the form:\n\ OBJECT:MONO:COLOR (ie em:bold:brightblue:white)\n\ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n"), buffer); if (!dump_output_immediately) { - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } exit(1); } @@ -502,7 +502,7 @@ PRIVATE int style_readFromFileREC ARGS2(char*, file, int, toplevel) if (!fh) { /* this should probably be an alert or something */ - CTRACE((tfp, "CSS:Can't open style file %s, using defaults\n", file)); + CTRACE((tfp, "CSS:Can't open style file '%s', using defaults\n", file)); return -1; } diff --git a/src/LYTraversal.c b/src/LYTraversal.c index 14253b01..6cf521b2 100644 --- a/src/LYTraversal.c +++ b/src/LYTraversal.c @@ -27,7 +27,7 @@ PRIVATE void final_perror ARGS2(CONST char *,msg, BOOLEAN, clean_flag) PRIVATE void exit_with_perror ARGS1(CONST char *,msg) { final_perror(msg, TRUE); - exit_immediately(-1); + exit_immediately(EXIT_FAILURE); } PUBLIC BOOLEAN lookup ARGS1(char *,target) diff --git a/src/LYUtils.c b/src/LYUtils.c index 1cd2a119..103056e8 100644 --- a/src/LYUtils.c +++ b/src/LYUtils.c @@ -6573,7 +6573,7 @@ PUBLIC FILE *LYOpenTemp ARGS3( if (mktemp(lynx_temp_space) == 0 || mkdir(lynx_temp_space, 0700) < 0) { printf("%s: %s\n", lynx_temp_space, LYStrerror(errno)); - exit(-1); + exit(EXIT_FAILURE); } umask(old_mask); lynx_temp_subspace = 1; diff --git a/src/LYUtils.h b/src/LYUtils.h index 6d78a076..7e371764 100644 --- a/src/LYUtils.h +++ b/src/LYUtils.h @@ -34,8 +34,7 @@ #define LYIsPipeCommand(s) ((s)[0] == '|') -#define LYCharINTERRUPT1 (FROMASCII(3)) /* Control-C */ -#define LYCharINTERRUPT2 (FROMASCII(7)) /* Control-G */ +/* See definitions in src/LYCharVals.h. */ #define LYCharIsINTERRUPT(ch) ((ch) == LYCharINTERRUPT1 || ch == LYCharINTERRUPT2) #if defined(DOSPATH) || defined(__EMX__) |