Skip to content

Commit

Permalink
src-worddic: Warning when user dict is found in the old path .anthy
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwarat committed Apr 12, 2019
1 parent 08a7cf5 commit 703f5a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src-worddic/textdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <anthy/filemap.h>
#include <anthy/logger.h>
#include <anthy/textdict.h>
#include "dic_main.h"

Expand Down Expand Up @@ -112,6 +113,7 @@ anthy_textdict_scan(struct textdict *td, int offset, void *ptr,
int (*fun)(void *, int, const char *, const char *))
{
FILE *fp;
const char *old_path;
char buf[1024];
if (!td) {
return ;
Expand All @@ -120,6 +122,14 @@ anthy_textdict_scan(struct textdict *td, int offset, void *ptr,
if (!fp) {
return ;
}
old_path = anthy_get_user_dir (1);
if (!strncmp (td->fn, old_path, strlen (old_path))) {
anthy_log (
0,
"WARNING: Please move the old dict file %s to the new directory %s\n",
td->fn,
anthy_get_user_dir (0));
}
if (fseek(fp, offset, SEEK_SET)) {
fclose(fp);
return ;
Expand Down

0 comments on commit 703f5a7

Please sign in to comment.