On Sun, 23 Feb 2003, John Bradford wrote:
Since I started using using 7.0, my bookmarks have been lost on four occasions, but I haven't been able to reproduce the bug at will - has anybody else noticed this?
Yes, once (not a much help for bughunt) and resulted in zero-length bm.txt. Although this isn't a real fix, i thought now, that saveing into temporary file and renameing it after close may help to avoid damage when bm_srv crashes during save. Probably some error checking should be also added. --- cvs/dillo/dpi/bm_srv12.c 2003-02-16 18:45:54.000000000 +0200 +++ dillo/dpi/bm_srv12.c 2003-02-24 04:28:59.000000000 +0200 @@ -851,10 +851,12 @@ int Bms_save() BmSec *sec_node; GSList *list, *list2; GString *gstr = g_string_new(""); + gchar *BmTmp; struct stat TimeStamp; + BmTmp = g_strconcat(BmFile, ".tmp", NULL); /* open bm file */ - if (!(BmTxt = fopen(BmFile, "w"))) { + if (!(BmTxt = fopen(BmTmp, "w"))) { perror("[fopen]"); return 1; } @@ -884,6 +886,8 @@ int Bms_save() g_string_free(gstr, TRUE); fclose(BmTxt); + rename(BmTmp, BmFile); + g_free(BmTmp); /* keep track of the timestamp */ stat(BmFile, &TimeStamp);