+/* This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+
+ (C) 2001 by The Genes Development Team
+ Original author: Peter Verthez (Peter.Verthez@advalvas.be)
+*/
+
/* $Id$ */
/* $Name$ */
%{
#include "gedcom.h"
+#include "multilex.h"
+#include "encoding.h"
int count_level = 0;
int fail = 0;
int gedcom_high_level_debug = 0;
int compatibility = 0;
MECHANISM error_mechanism=IMMED_FAIL;
-char string_buf[MAXGEDCLINELEN+1];
+char string_buf[MAXGEDCLINELEN*4+1];
char *string_buf_ptr;
enum _COMPAT {
/* 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
| DELIM line_item { }
;
-line_item : anychar { CLEAR_BUFFER(string_buf);
+line_item : anychar { size_t i;
+ CLEAR_BUFFER(string_buf);
string_buf_ptr = string_buf;
/* The following also takes care of '@@' */
- *string_buf_ptr++ = $1[0];
+ if (!strncmp($1, "@@", 3))
+ *string_buf_ptr++ = '@';
+ else
+ for (i=0; i < strlen($1); i++)
+ *string_buf_ptr++ = $1[i];
$$ = string_buf;
}
| ESCAPE { CLEAR_BUFFER(string_buf);
YYERROR;
}
else {
+ size_t i;
/* The following also takes care of '@@' */
- *string_buf_ptr++ = $2[0];
+ if (!strncmp($2, "@@", 3))
+ *string_buf_ptr++ = '@';
+ else
+ for (i=0; i < strlen($2); i++)
+ *string_buf_ptr++ = $2[i];
$$ = string_buf;
}
}
{
return (compat_flags & compatibility);
}
+