diff --git a/dict/main.c b/dict/main.c
index 8240b756f55aa57482b2a2fa13a0cbb00fa7f58d..e5573fea55a25a90f4ad79493f38ec58e3886a3b 100644
--- a/dict/main.c
+++ b/dict/main.c
@@ -51,7 +51,7 @@ data = new_data(db);
bootstrap(data);
setlocale(LC_ALL, "");
- initscr();
+ initscr();
noecho();
cbreak();
keypad(stdscr, TRUE);
diff --git a/importer/main.c b/importer/main.c
index a1850f830b62b9e0166f1a72735883e56f338003..d03774569333e62028a03a3789df97878026daf6 100644
--- a/importer/main.c
+++ b/importer/main.c
@@ -49,6 +49,8 @@ Data *data;
FILE *f;
int total;
+ printf("\33[?25l"); // hide cursor
+
data = new_data(":memory:");
f = fopen(txt, "r");
@@ -62,10 +64,20 @@ if (line[0] == '#' || line[0] == '\n')
continue;
insert(data, line, read-1);
+ count++;
- float t = ((float)count/(float)total)*100;
- printf("\rLoading data [%03.0f%%] %d/%d", t, count, total);
+ if ((count % 321) == 0){
+ float t = ((float)count/(float)total)*100;
+ printf("\rLoading data [%03.0f%%] %d/%d", t, count, total);
+ }
}
- return load_or_save_db(data->db, db, 1);
+ float t = ((float)count/(float)total)*100;
+ printf("\rLoading data [%03.0f%%] %d/%d", t, count, total);
+ int r = load_or_save_db(data->db, db, 1);
+
+ printf("\rDONE!");
+ printf("\33[?25h"); // reenable cursor
+
+ return r;
}