chiark / gitweb /
New Word dictionary and new disambiguation algorithm
[ypp-sc-tools.db-test.git] / pctb / common.c
index 3cb4323151c86cbc46a0c80cfe73241537e253ac..bc1cb8df749cb63ec2ef392300551c37262c6e16 100644 (file)
@@ -88,8 +88,14 @@ int dbfile_scanf(const char *fmt, ...) {
 }
 
 void dbfile_assertfail(const char *file, int line, const char *m) {
-  fatal("Error in database file %s at byte %ld:\n"
-       " Requirement not met at %s:%d:\n"
-       " %s",
-       path,(long)ftell(dbfile), file,line, m);
+  if (dbfile)
+    fatal("Error in dictionary file %s at byte %ld:\n"
+         " Requirement not met at %s:%d:\n"
+         " %s",
+         path,(long)ftell(dbfile), file,line, m);
+  else
+    fatal("Semantic error in dictionaries:\n"
+         " Requirement not met at %s:%d:\n"
+         " %s",
+         file,line, m);
 }