Return error (0) rather than exit for bad dict header (magic)
[idzebra-moved-to-github.git] / dict / dicttest.c
index 0138e2c..331f5f5 100644 (file)
@@ -1,6 +1,6 @@
-/* $Id: dicttest.c,v 1.31 2004-12-08 12:23:08 adam Exp $
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
-   Index Data Aps
+/* $Id: dicttest.c,v 1.35 2005-09-13 11:51:05 adam Exp $
+   Copyright (C) 1995-2005
+   Index Data ApS
 
 This file is part of the Zebra server.
 
@@ -26,7 +26,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <ctype.h>
 
 #include <idzebra/dict.h>
-#include <zebrautl.h>
+#include <idzebra/util.h>
+#include <idzebra/res.h>
+#include <yaz/yaz-util.h>
 
 char *prog;
 static Dict dict;
@@ -158,12 +160,14 @@ int main (int argc, char **argv)
         yaz_log (YLOG_FATAL, "no config and/or dictionary specified");
         exit (1);
     }
-    my_resource = res_open (config, 0, 0);
+    my_resource = res_open(0, 0);
     if (!my_resource)
     {
         yaz_log (YLOG_FATAL, "cannot open resource `%s'", config);
         exit (1);
     }
+    res_read_file(my_resource, config);
+
     bfs = bfs_create (res_get(my_resource, "register"), 0);
     if (!bfs)
     {