diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-24 17:36:44 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-24 17:36:44 +0000 |
commit | 9cfb271a6713f47025627c816119f224b0952498 (patch) | |
tree | 2131f542ac1992f58d0cb507e4e74a21d6556218 | |
parent | [w3m-dev 03682] open null file on tab (diff) | |
download | w3m-9cfb271a6713f47025627c816119f224b0952498.tar.gz w3m-9cfb271a6713f47025627c816119f224b0952498.zip |
[w3m-dev 03683] interrupt in getNextPage()
* file.c (getNextPage): trap SIGINT
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | file.c | 28 |
2 files changed, 26 insertions, 9 deletions
@@ -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 $ @@ -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; |