[w3m-dev 03530] save history
* history.c (saveHistory): save tmpfile and rename From: Takahashi Youichirou <nikuq@hk.airnet.ne.jp>
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2002-12-06 Takahashi Youichirou <nikuq@hk.airnet.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03530] save history
|
||||||
|
* history.c (saveHistory): save tmpfile and rename
|
||||||
|
|
||||||
2002-12-06 Fumitoshi UKAI <ukai@debian.or.jp>
|
2002-12-06 Fumitoshi UKAI <ukai@debian.or.jp>
|
||||||
|
|
||||||
* NEWS: func: ACCESSKEY, LINK_MENU
|
* NEWS: func: ACCESSKEY, LINK_MENU
|
||||||
@@ -5537,4 +5542,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.594 2002/12/05 16:32:45 ukai Exp $
|
$Id: ChangeLog,v 1.595 2002/12/05 16:34:33 ukai Exp $
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* $Id: history.c,v 1.7 2002/01/26 17:24:01 ukai Exp $ */
|
/* $Id: history.c,v 1.8 2002/12/05 16:34:33 ukai Exp $ */
|
||||||
#include "fm.h"
|
#include "fm.h"
|
||||||
|
|
||||||
#ifdef USE_HISTORY
|
#ifdef USE_HISTORY
|
||||||
@@ -54,10 +54,12 @@ saveHistory(Hist *hist, size_t size)
|
|||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
HistItem *item;
|
HistItem *item;
|
||||||
|
char *tmpf;
|
||||||
|
|
||||||
if (hist == NULL || hist->list == NULL)
|
if (hist == NULL || hist->list == NULL)
|
||||||
return;
|
return;
|
||||||
if ((f = fopen(rcFile(HISTORY_FILE), "w")) == NULL) {
|
tmpf = tmpfname(TMPF_DFL, NULL)->ptr;
|
||||||
|
if ((f = fopen(tmpf, "w")) == NULL) {
|
||||||
disp_err_message("Can't open history", FALSE);
|
disp_err_message("Can't open history", FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -67,6 +69,7 @@ saveHistory(Hist *hist, size_t size)
|
|||||||
for (; item; item = item->next)
|
for (; item; item = item->next)
|
||||||
fprintf(f, "%s\n", (char *)item->ptr);
|
fprintf(f, "%s\n", (char *)item->ptr);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
rename(tmpf, rcFile(HISTORY_FILE));
|
||||||
}
|
}
|
||||||
#endif /* USE_HISTORY */
|
#endif /* USE_HISTORY */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user