dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 0.5
[gedcom-parse.git]
/
gedcom.y
diff --git
a/gedcom.y
b/gedcom.y
index b455587196502464fb3ac9da71f9b519f2099b7f..8aad4fd9f02ed3726ac82eaf78c800fbc3568f65 100644
(file)
--- a/
gedcom.y
+++ b/
gedcom.y
@@
-122,6
+122,7
@@
%{
#include "gedcom.h"
%{
#include "gedcom.h"
+#include "multilex.h"
int count_level = 0;
int fail = 0;
int count_level = 0;
int fail = 0;
@@
-129,7
+130,7
@@
int compat_enabled = 1;
int gedcom_high_level_debug = 0;
int compatibility = 0;
MECHANISM error_mechanism=IMMED_FAIL;
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 {
char *string_buf_ptr;
enum _COMPAT {
@@
-2109,10
+2110,15
@@
opt_line_item : /* empty */ { }
| DELIM line_item { }
;
| 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 = 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);
$$ = string_buf;
}
| ESCAPE { CLEAR_BUFFER(string_buf);
@@
-2126,8
+2132,13
@@
line_item : anychar { CLEAR_BUFFER(string_buf);
YYERROR;
}
else {
YYERROR;
}
else {
+ size_t i;
/* The following also takes care of '@@' */
/* 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;
}
}
$$ = string_buf;
}
}
@@
-2436,3
+2447,4
@@
int compat_mode(int compat_flags)
{
return (compat_flags & compatibility);
}
{
return (compat_flags & compatibility);
}
+