commit 5ffb12c00c055b231106aa39cedc40ff81507406
parent d1a44eb9481f18ca12e7e2c4bd47924ab26a07a1
Author: ukai <ukai>
Date: Tue, 22 Jul 2003 17:29:47 +0000
[w3m-dev 03942] Save history
* history.c (saveHistory): check tmpfile write error
From: Takahashi Youichirou <nikuq@hk.airnet.ne.jp>
Diffstat:
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,3 +1,8 @@
+2003-07-23 Takahashi Youichirou <nikuq@hk.airnet.ne.jp>
+
+ * [w3m-dev 03942] Save history
+ * history.c (saveHistory): check tmpfile write error
+
2003-07-23 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 03941] fix character encoding for 'v'
diff --git a/history.c b/history.c
@@ -72,7 +72,10 @@ saveHistory(Hist *hist, size_t size)
size++;
for (; item; item = item->next)
fprintf(f, "%s\n", (char *)item->ptr);
- fclose(f);
+ if (fclose(f) == EOF) {
+ disp_err_message("Can't save history", FALSE);
+ return;
+ }
rename(tmpf, rcFile(HISTORY_FILE));
}
#endif /* USE_HISTORY */