bugfix/record-dot-c で src-worddic/record.c の bug fix です。
anon の時に
~/.anthy/last-record1_.utf8
~/.anthy/last-record2_.utf8
というファイルが作られてしまいましたがこれが直ると思います。
sync_del_and_del が呼ばれた際に、更新があったとき read_base_record が
呼ばれると思います。
2010-06-22 NIIBE Yutaka <[email protected]>
* src-worddic/record.c (check_base_record_uptodate): Return 0 when
is_anon is valid.
Correct condition when it's up-to-date.
(commit_add_row): Don't write when is_anon is valid.
(sync_add): Correct condition.
diff --git a/src-worddic/record.c b/src-worddic/record.c
index 3707cee..93bfc48 100644
--- a/src-worddic/record.c
+++ b/src-worddic/record.c
@@ -972,12 +972,12 @@ check_base_record_uptodate(struct record_stat *rst)
{
struct stat st;
if (rst->is_anon) {
- return 1;
+ return 0;
}
anthy_check_user_dir();
if (stat(rst->base_fn, &st) < 0) {
return 0;
- } else if (st.st_mtime != rst->base_timestamp) {
+ } else if (st.st_mtime == rst->base_timestamp) {
return 0;
}
return 1;
@@ -1245,6 +1245,9 @@ commit_add_row(struct record_stat* rst,
FILE* fp;
int i;
+ if (rs->is_anon)
+ return ;
+
fp = fopen(rst->journal_fn, "a");
if (fp == NULL) {
return;
@@ -1530,7 +1533,7 @@ sync_add(struct record_stat* rst, struct record_section*
rsc,
struct trie_node* node)
{
lock_record(rst);
- if (check_base_record_uptodate(rst)) {
+ if (!check_base_record_uptodate(rst)) {
node->dirty |= PROTECT;
/* 差分ファイルだけ読む */
read_journal_record(rst);
_______________________________________________
Anthy-dev mailing list
[email protected]
http://lists.sourceforge.jp/mailman/listinfo/anthy-dev