Work on truncation.
[idzebra-moved-to-github.git] / util / charmap.c
index 3f5abdf..d7b2146 100644 (file)
@@ -4,7 +4,16 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: charmap.c,v $
- * Revision 1.6  1996-06-04 13:28:00  quinn
+ * Revision 1.9  1996-10-29 13:48:14  adam
+ * Updated to use zebrautl.h instead of alexutil.h.
+ *
+ * Revision 1.8  1996/10/18 12:39:23  adam
+ * Uses LOG_DEBUG instead of LOG_WARN for "Character map overlap".
+ *
+ * Revision 1.7  1996/06/06  12:08:56  quinn
+ * Fixed bug.
+ *
+ * Revision 1.6  1996/06/04  13:28:00  quinn
  * More work on charmapping
  *
  * Revision 1.5  1996/06/04  08:32:15  quinn
@@ -34,7 +43,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include <alexutil.h>
+#include <zebrautl.h>
 #include <yaz-util.h>
 #include <charmap.h>
 #include <tpath.h>
@@ -85,7 +94,7 @@ static chr_t_entry *set_map_string(chr_t_entry *root, char *from, int len,
            (char*) root->target == CHR_UNKNOWN)
            root->target = (unsigned char *) xstrdup(to);
        else if ((char*) to != CHR_SPACE)
-           logf(LOG_WARN, "Character map overlap");
+           logf(LOG_DEBUG, "Character map overlap");
     }
     else
     {
@@ -147,8 +156,8 @@ static chr_t_entry *find_entry(chr_t_entry *t, char **from, int len)
        /* no match */
        *from = pos;
     }
-    /* no children match. use ourselves */
-   return t;
+    /* no children match. use ourselves, if we have a target */
+   return t->target ? t : 0;
 }
 
 char **chr_map_input(chr_t_entry *t, char **from, int len)