diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-22 15:56:49 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2003-01-22 15:56:49 +0000 |
commit | 9241f55eee8c74450dde9c6799372f881469679f (patch) | |
tree | 924e43640da5feaf0bc95242c8fcfaf1f8c60c89 | |
parent | [w3m-dev 03671] Re: config.param is clear when configure -help (diff) | |
download | w3m-9241f55eee8c74450dde9c6799372f881469679f.tar.gz w3m-9241f55eee8c74450dde9c6799372f881469679f.zip |
[w3m-dev 03674] -dump problem
* file.c (loadGeneralFile): return NULL when dump
* main.c (dump_source): deleted
(dump_head): deleted
(dupm_extra): deleted
(do_dump): added
(main): singal when dump
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | main.c | 48 |
3 files changed, 44 insertions, 20 deletions
@@ -1,3 +1,13 @@ +2003-01-23 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> + + * [w3m-dev 03674] -dump problem + * file.c (loadGeneralFile): return NULL when dump + * main.c (dump_source): deleted + (dump_head): deleted + (dupm_extra): deleted + (do_dump): added + (main): singal when dump + 2003-01-23 Yoshinobu Sakane <sakane@d4.bsd.nes.nec.co.jp> * [w3m-dev 03671] Re: config.param is clear when configure -help @@ -6668,4 +6678,4 @@ a * [w3m-dev 03276] compile error on EWS4800 * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.700 2003/01/22 15:53:12 ukai Exp $ +$Id: ChangeLog,v 1.701 2003/01/22 15:56:49 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.195 2003/01/20 15:32:03 ukai Exp $ */ +/* $Id: file.c,v 1.196 2003/01/22 15:56:50 ukai Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -2062,6 +2062,8 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer, return NO_BUFFER; } } + else if (w3m_dump & DUMP_FRAME) + return NULL; if (flag & RG_FRAME) { if (t_buf == NULL) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.195 2003/01/17 17:06:04 ukai Exp $ */ +/* $Id: main.c,v 1.196 2003/01/22 15:56:50 ukai Exp $ */ #define MAINPROGRAM #include "fm.h" #include <signal.h> @@ -80,9 +80,7 @@ static char *getCurWord(Buffer *buf, int *spos, int *epos, const char *badchars); static int display_ok = FALSE; -static void dump_source(Buffer *); -static void dump_head(Buffer *); -static void dump_extra(Buffer *); +static void do_dump(Buffer *); int prec_num = 0; int prev_key = -1; int on_target = 1; @@ -752,6 +750,8 @@ main(int argc, char **argv, char **envp) if (w3m_backend) backend(); + if (w3m_dump) + signal(SIGINT, SIG_IGN); #ifdef SIGCHLD signal(SIGCHLD, sig_chld); #endif @@ -900,22 +900,13 @@ main(int argc, char **argv, char **envp) Currentbuf->nextBuffer = newbuf; Currentbuf = newbuf; } - if (w3m_dump) { - if (w3m_dump & DUMP_EXTRA) - dump_extra(Currentbuf); - if (w3m_dump & DUMP_HEAD) - dump_head(Currentbuf); - if (w3m_dump & DUMP_SOURCE) - dump_source(Currentbuf); - if (w3m_dump == DUMP_BUFFER) { - if (Currentbuf->frameset != NULL && RenderFrame) - rFrame(); - saveBuffer(Currentbuf, stdout); - } - } - else { + if (!w3m_dump || w3m_dump == DUMP_BUFFER) { if (Currentbuf->frameset != NULL && RenderFrame) rFrame(); + } + if (w3m_dump) + do_dump(Currentbuf); + else { Currentbuf = newbuf; #ifdef USE_BUFINFO saveBufferInfo(); @@ -1167,6 +1158,27 @@ dump_extra(Buffer *buf) #endif } +static void +do_dump(Buffer *buf) +{ + MySignalHandler(*volatile prevtrap) (SIGNAL_ARG) = NULL; + + prevtrap = signal(SIGINT, intTrap); + if (SETJMP(IntReturn) != 0) { + signal(SIGINT, prevtrap); + return; + } + if (w3m_dump & DUMP_EXTRA) + dump_extra(buf); + if (w3m_dump & DUMP_HEAD) + dump_head(buf); + if (w3m_dump & DUMP_SOURCE) + dump_source(buf); + if (w3m_dump == DUMP_BUFFER) + saveBuffer(buf, stdout); + signal(SIGINT, prevtrap); +} + void nulcmd(void) { /* do nothing */ |