From 1d0ba25a660483da1272a31dd077ed94441e3d9f Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Sat, 2 Jan 2021 09:20:37 +0900 Subject: New upstream version 0.5.3+git20210102 --- etc.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'etc.c') diff --git a/etc.c b/etc.c index 8fe1215..801b098 100644 --- a/etc.c +++ b/etc.c @@ -498,7 +498,7 @@ calcPosition(char *l, Lineprop *pr, int len, int pos, int bpos, int mode) static char *prevl = NULL; int i, j; - if (l == NULL || len == 0) + if (l == NULL || len == 0 || pos < 0) return bpos; if (l == prevl && mode == CP_AUTO) { if (pos <= len) @@ -634,24 +634,6 @@ strerror(int errno) } #endif /* not HAVE_STRERROR */ -#ifndef HAVE_SYS_ERRLIST -char **sys_errlist; - -prepare_sys_errlist() -{ - int i, n; - - i = 1; - while (strerror(i) != NULL) - i++; - n = i; - sys_errlist = New_N(char *, n); - sys_errlist[0] = ""; - for (i = 1; i < n; i++) - sys_errlist[i] = strerror(i); -} -#endif /* not HAVE_SYS_ERRLIST */ - int next_status(char c, int *status) { @@ -727,6 +709,11 @@ next_status(char c, int *status) case '>': *status = R_ST_NORMAL; break; + case 'D': + case 'd': + /* could be a !doctype */ + *status = R_ST_TAG; + break; default: *status = R_ST_IRRTAG; } @@ -1365,7 +1352,13 @@ setup_child(int child, int i, int f) if (!child) SETPGRP(); #endif /* __MINGW32_VERSION */ + /* + * I don't know why but close_tty() sometimes interrupts loadGeneralFile() in loadImage() + * and corrupt image data can be cached in ~/.w3m. + */ +#if 0 close_tty(); +#endif close_all_fds_except(i, f); QuietMessage = TRUE; fmInitialized = FALSE; -- cgit v1.2.3