aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--file.c4
-rw-r--r--main.c48
3 files changed, 44 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index f35cedd..f88b095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
diff --git a/file.c b/file.c
index e7e840c..dafe2e7 100644
--- a/file.c
+++ b/file.c
@@ -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)
diff --git a/main.c b/main.c
index 428d2ae..094cb0c 100644
--- a/main.c
+++ b/main.c
@@ -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 */