diff options
| author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-04 16:45:40 +0000 | 
|---|---|---|
| committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-12-04 16:45:40 +0000 | 
| commit | f8e094d717635b55d2502bd792d91e2dcc68acec (patch) | |
| tree | ab82ac31b4482d66e3c670ded8e7e2424292f007 | |
| parent | [w3m-dev-en 00841] Re: w3m segfaults if the terminal is not writable (diff) | |
| download | w3m-f8e094d717635b55d2502bd792d91e2dcc68acec.tar.gz w3m-f8e094d717635b55d2502bd792d91e2dcc68acec.zip  | |
[w3m-dev 03521] sync option
* display.c (redrawNLine): calcTabPos()
* func.c (initKeymap): return if keymap_initialized
* main.c (calcTabPos): no more static
	(main): move sync_with_option, initCookie, setLocalCookie
		move backend
		move initKeymap, initMouseAction, initMenu
		remove calcTabPos
		add displayBuffer
	(numTab): static
	(deleteTab): delete calcTabPos
	(moveTab): delete calcTabPos
* proto.h (calcTabPos): added
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
| -rw-r--r-- | ChangeLog | 18 | ||||
| -rw-r--r-- | display.c | 3 | ||||
| -rw-r--r-- | func.c | 4 | ||||
| -rw-r--r-- | main.c | 48 | ||||
| -rw-r--r-- | proto.h | 3 | 
5 files changed, 39 insertions, 37 deletions
@@ -1,5 +1,21 @@  2002-12-05  Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> +	* [w3m-dev 03521] sync option +	* display.c (redrawNLine): calcTabPos() +	* func.c (initKeymap): return if keymap_initialized +	* main.c (calcTabPos): no more static +		(main): move sync_with_option, initCookie, setLocalCookie +			move backend +			move initKeymap, initMouseAction, initMenu +			remove calcTabPos +			add displayBuffer +		(numTab): static +		(deleteTab): delete calcTabPos +		(moveTab): delete calcTabPos +	* proto.h (calcTabPos): added +		 +2002-12-05  Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> +  	* [w3m-dev-en 00841] Re: w3m segfaults if the terminal is not writable  	* terms.c (reset_tty): don't close stderr @@ -5399,4 +5415,4 @@ a	* [w3m-dev 03276] compile error on EWS4800  	* release-0-2-1  	* import w3m-0.2.1 -$Id: ChangeLog,v 1.583 2002/12/04 16:38:53 ukai Exp $ +$Id: ChangeLog,v 1.584 2002/12/04 16:45:40 ukai Exp $ @@ -1,4 +1,4 @@ -/* $Id: display.c,v 1.42 2002/12/03 15:52:38 ukai Exp $ */ +/* $Id: display.c,v 1.43 2002/12/04 16:45:41 ukai Exp $ */  #include <signal.h>  #include "fm.h" @@ -453,6 +453,7 @@ redrawNLine(Buffer *buf, int n)  	TabBuffer *t;  	int l; +	calcTabPos();  	move(0, 0);  #ifdef USE_MOUSE  	if (mouse_action.menu_str) @@ -1,4 +1,4 @@ -/* $Id: func.c,v 1.20 2002/12/03 16:09:41 ukai Exp $ */ +/* $Id: func.c,v 1.21 2002/12/04 16:45:41 ukai Exp $ */  /*   * w3m func.c   */ @@ -120,7 +120,7 @@ initKeymap(int force)      struct stat kstat;      extern int str_to_bool(char *value, int old); -    if (!force && !keymap_initialized) +    if (!force && keymap_initialized)  	return;      if ((kf = fopen(rcFile(keymap_file), "rt")) == NULL || @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.158 2002/12/03 16:09:43 ukai Exp $ */ +/* $Id: main.c,v 1.159 2002/12/04 16:45:41 ukai Exp $ */  #define MAINPROGRAM  #include "fm.h"  #include <signal.h> @@ -102,7 +102,6 @@ void set_buffer_environ(Buffer *);  static void _followForm(int);  static void _goLine(char *);  static void _newT(void); -static void calcTabPos(void);  static void followTab(TabBuffer * tab);  static void moveTab(TabBuffer * t, TabBuffer * t2, int right);  static int check_target = TRUE; @@ -710,12 +709,6 @@ main(int argc, char **argv, char **envp)  	i++;      } -    sync_with_option(); -#ifdef USE_COOKIE -    initCookie(); -#endif				/* USE_COOKIE */ -    setLocalCookie();		/* setup cookie for local CGI */ -  #ifdef	__WATT32__      if (w3m_debug)  	dbug_init(); @@ -742,9 +735,7 @@ main(int argc, char **argv, char **envp)  #ifdef USE_BINMODE_STREAM      setmode(fileno(stdout), O_BINARY);  #endif -    if (w3m_backend) -	backend(); -    if (!w3m_dump) { +    if (!w3m_dump && !w3m_backend) {  	fmInit();  #ifdef SIGWINCH  	signal(SIGWINCH, resize_hook); @@ -752,18 +743,21 @@ main(int argc, char **argv, char **envp)  	setlinescols();  	setupscreen();  #endif				/* not SIGWINCH */ -	initKeymap(TRUE); -#ifdef USE_MOUSE -	initMouseAction(); -#endif				/* MOUSE */ -#ifdef USE_MENU -	initMenu(); -#endif				/* MENU */      }  #ifdef USE_IMAGE      else if (w3m_halfdump && displayImage)  	activeImage = TRUE;  #endif + +    sync_with_option(); +#ifdef USE_COOKIE +    initCookie(); +#endif				/* USE_COOKIE */ +    setLocalCookie();		/* setup cookie for local CGI */ + +    if (w3m_backend) +	backend(); +  #ifdef SIGCHLD      signal(SIGCHLD, sig_chld);  #endif @@ -902,7 +896,6 @@ main(int argc, char **argv, char **envp)  	if (CurrentTab == NULL) {  	    FirstTab = LastTab = CurrentTab = newTab();  	    nTab = 1; -	    calcTabPos();  	    Firstbuf = Currentbuf = newbuf;  	}  	else if (open_new_tab) { @@ -949,7 +942,6 @@ main(int argc, char **argv, char **envp)  	if (!FirstTab) {  	    FirstTab = LastTab = CurrentTab = newTab();  	    nTab = 1; -	    calcTabPos();  	}  	if (!Firstbuf || Firstbuf == NO_BUFFER) {  	    Firstbuf = Currentbuf = newBuffer(INIT_BUFFER_WIDTH); @@ -5590,19 +5582,14 @@ reinit()  #ifdef USE_COOKIE  	initCookie();  #endif -	initKeymap(TRUE); -#ifdef USE_MOUSE -	initMouseAction(); -#endif -#ifdef USE_MENU -	initMenu(); -#endif +	displayBuffer(Currentbuf, B_REDRAW_IMAGE);  	return;      }      if (!strcasecmp(resource, "CONFIG") || !strcasecmp(resource, "RC")) {  	init_rc(config_filename);  	sync_with_option(); +	displayBuffer(Currentbuf, B_REDRAW_IMAGE);  	return;      } @@ -5713,7 +5700,6 @@ _newT(void)      CurrentTab->nextTab = tag;      CurrentTab = tag;      nTab++; -    calcTabPos();  }  void @@ -5723,7 +5709,7 @@ newT(void)      displayBuffer(Currentbuf, B_REDRAW_IMAGE);  } -TabBuffer * +static TabBuffer *  numTab(int n)  {      TabBuffer *tab; @@ -5739,7 +5725,7 @@ numTab(int n)      return tab;  } -static void +void  calcTabPos(void)  {      TabBuffer *tab; @@ -5819,7 +5805,6 @@ deleteTab(TabBuffer * tab)  	    CurrentTab = tab->nextTab;      }      nTab--; -    calcTabPos();      buf = tab->firstBuffer;      while (buf && buf != NO_BUFFER) {  	next = buf->nextBuffer; @@ -6018,7 +6003,6 @@ moveTab(TabBuffer * t, TabBuffer * t2, int right)  	    FirstTab = t;  	t2->prevTab = t;      } -    calcTabPos();      displayBuffer(Currentbuf, B_FORCE_REDRAW);  } @@ -1,4 +1,4 @@ -/* $Id: proto.h,v 1.64 2002/12/03 16:01:44 ukai Exp $ */ +/* $Id: proto.h,v 1.65 2002/12/04 16:45:41 ukai Exp $ */  /*    *   This file was automatically generated by version 1.7 of cextract.   *   Manual editing not recommended. @@ -227,6 +227,7 @@ extern int matchattr(char *p, char *attr, int len, Str *value);  extern void readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu);  extern char *checkHeader(Buffer *buf, char *field);  extern TabBuffer *newTab(void); +extern void calcTabPos(void);  extern TabBuffer *deleteTab(TabBuffer *tab);  extern void addDownloadList(pid_t pid, char *url, char *save, char *lock,  			    clen_t size);  | 
