reset error for retrieve. Remove sleep call
[idzebra-moved-to-github.git] / util / charmap.c
index fdbf0bf..a9ddf72 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.
  * Sebastian Hammer, Adam Dickmeiss
  *
- * $Id: charmap.c,v 1.19 2002-02-18 11:47:23 adam Exp $
+ * $Id: charmap.c,v 1.22 2002-05-03 13:46:05 adam Exp $
  *
  */
 
@@ -185,7 +185,7 @@ const char *chr_map_output(chrmaptab maptab, const char **from, int len)
 unsigned char zebra_prim(char **s)
 {
     unsigned char c;
-    unsigned int i;
+    unsigned int i = 0;
 
     yaz_log (LOG_DEBUG, "prim %.3s", *s);
     if (**s == '\\')
@@ -357,7 +357,8 @@ static int scan_string(char *s,
     return 0;
 }
 
-chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only)
+chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only,
+                           const char *tabroot)
 {
     FILE *f;
     char line[512], *argv[50];
@@ -368,7 +369,7 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only)
     NMEM nmem;
 
     logf (LOG_DEBUG, "maptab %s open", name);
-    if (!(f = yaz_path_fopen(tabpath, name, "r")))
+    if (!(f = yaz_fopen(tabpath, name, "r", tabroot)))
     {
        logf(LOG_WARN|LOG_ERRNO, "%s", name);
        return 0;
@@ -510,7 +511,7 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only)
            logf(LOG_WARN, "Syntax error at '%s' in %s", line, name);
        }
     
-    fclose(f);
+    yaz_fclose(f);
     if (errors)
     {
        chrmaptab_destroy(res);