Set GCONV_PATH for make test (to pick up ANSEL encoding module).
[gedcom-parse.git] / gedcom.y
index 7b8b2ef421440c6e4c36d4f0ea44dd76b6788729..b54286cb2aa35625fececb788d9a7e08415fb30a 100644 (file)
--- a/gedcom.y
+++ b/gedcom.y
 %{
 #include "gedcom.h"
 #include "multilex.h"
+#include "encoding.h"
 
 int  count_level    = 0;
 int  fail           = 0;
@@ -568,7 +569,8 @@ head_gedc_form_sect : OPEN DELIM TAG_FORM mand_line_item
 
 /* HEAD.CHAR */
 head_char_sect : OPEN DELIM TAG_CHAR mand_line_item 
-                 { START(CHAR) }
+                 { if (open_conv_to_internal($4) == 0) YYERROR;
+                  START(CHAR) }
                  head_char_subs
                 { CHECK0 }
                  CLOSE
@@ -2110,7 +2112,7 @@ opt_line_item : /* empty */ { }
               | DELIM line_item { }
               ;
 
-line_item   : anychar  { int i;
+line_item   : anychar  { size_t i;
                         CLEAR_BUFFER(string_buf);
                          string_buf_ptr = string_buf;
                         /* The following also takes care of '@@' */
@@ -2132,7 +2134,7 @@ line_item   : anychar  { int i;
                      YYERROR;
                    }
                    else {
-                     int i;
+                     size_t i;
                      /* The following also takes care of '@@' */
                      if (!strncmp($2, "@@", 3))
                        *string_buf_ptr++ = '@';