aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog7
-rw-r--r--file.c28
2 files changed, 26 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index d5c57e9..d066245 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2003-01-25 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03683] interrupt in getNextPage()
+ * file.c (getNextPage): trap SIGINT
+
+2003-01-25 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03682] open null file on tab
* display.c (displayBuffer): if empty, clear()
@@ -6837,4 +6842,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.713 2003/01/24 17:34:36 ukai Exp $
+$Id: ChangeLog,v 1.714 2003/01/24 17:36:44 ukai Exp $
diff --git a/file.c b/file.c
index 784c97c..5f0aa79 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.204 2003/01/23 18:38:06 ukai Exp $ */
+/* $Id: file.c,v 1.205 2003/01/24 17:36:45 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -7192,24 +7192,25 @@ openGeneralPagerBuffer(InputStream stream)
Line *
getNextPage(Buffer *buf, int plen)
{
- Line *top = buf->topLine, *last = buf->lastLine, *cur = buf->currentLine;
- int i, nlines = 0;
+ Line *volatile top = buf->topLine, *volatile last = buf->lastLine,
+ *volatile cur = buf->currentLine;
+ int i;
+ int volatile nlines = 0;
clen_t linelen = 0, trbyte = buf->trbyte;
Str lineBuf2;
- char pre_lbuf = '\0';
+ char volatile pre_lbuf = '\0';
URLFile uf;
- char code;
- int squeeze_flag = FALSE;
+ char volatile code;
+ int volatile squeeze_flag = FALSE;
Lineprop *propBuffer = NULL;
#ifdef USE_ANSI_COLOR
Linecolor *colorBuffer = NULL;
#endif
+ MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL;
if (buf->pagerSource == NULL)
return NULL;
- if (fmInitialized)
- crmode();
if (last != NULL) {
nlines = last->real_linenumber;
pre_lbuf = *(last->lineBuf);
@@ -7224,6 +7225,14 @@ getNextPage(Buffer *buf, int plen)
else
code = DocumentCode;
#endif
+
+ if (SETJMP(AbortLoading) != 0) {
+ goto pager_end;
+ }
+ prevtrap = signal(SIGINT, KeyAbort);
+ if (fmInitialized)
+ term_cbreak();
+
init_stream(&uf, SCM_UNKNOWN, NULL);
for (i = 0; i < plen; i++) {
lineBuf2 = StrmyISgets(buf->pagerSource);
@@ -7284,8 +7293,11 @@ getNextPage(Buffer *buf, int plen)
buf->firstLine->prev = NULL;
}
}
+ pager_end:
if (fmInitialized)
term_raw();
+ signal(SIGINT, prevtrap);
+
buf->trbyte = trbyte + linelen;
#ifdef JP_CHARSET
buf->document_code = code;