Bug fix in fml_sub0.
[egate.git] / fml / fml.c
index d5f5af3..4eabb90 100644 (file)
--- a/fml/fml.c
+++ b/fml/fml.c
@@ -2,7 +2,17 @@
  * FML interpreter. Europagate, 1995
  *
  * $Log: fml.c,v $
- * Revision 1.7  1995/02/10 15:50:54  adam
+ * Revision 1.10  1995/02/21 17:46:08  adam
+ * Bug fix in fml_sub0.
+ *
+ * Revision 1.9  1995/02/21  14:00:03  adam
+ * Minor changes.
+ *
+ * Revision 1.8  1995/02/10  18:15:52  adam
+ * FML function 'strcmp' implemented. This function can be used to
+ * test for existence of MARC fields.
+ *
+ * Revision 1.7  1995/02/10  15:50:54  adam
  * MARC interface implemented. Minor bugs fixed. fmltest can
  * be used to format single MARC records. New function '\list'
  * implemented.
@@ -126,6 +136,7 @@ Fml fml_open (void)
     fml_list_init (fml);
     fml_arit_init (fml);
     fml_rel_init (fml);
+    fml_str_init (fml);
 
     sym_info = fml_sym_add (fml->sym_tab, "s");
     sym_info->kind = FML_CPREFIX;
@@ -527,9 +538,13 @@ static struct fml_node *fml_sub0 (Fml fml, struct fml_node *list)
     if (!list)
         return NULL;
     fml_init_token (&token, fml);
-    assert (list);
     fml_cmd_lex (&list, &token);
     fn1 = fn = fml_sub1 (fml, &list, &token);
+    if (!fn)
+    {
+        fml_del_token (&token, fml);
+        return fn;
+    }
     if (fn->p[1] && token.kind != '\0')
     {
         fn1 = fml_node_alloc (fml);