summaryrefslogtreecommitdiff
path: root/epan/dtd_parse.l
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2005-09-20 00:31:53 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2005-09-20 00:31:53 +0000
commitc9433207217d0ee3165a433f7666d6f6335afa38 (patch)
treebde51fa78cb23eb7d2e9e12954da1a37156a1d7f /epan/dtd_parse.l
parent44a4fd449ceebc441d80e9af175dfb8b022f689a (diff)
downloadwireshark-c9433207217d0ee3165a433f7666d6f6335afa38.tar.gz
avoid freeing the last location twice.
add some #ifed out code to help debugging the parser svn path=/trunk/; revision=15884
Diffstat (limited to 'epan/dtd_parse.l')
-rw-r--r--epan/dtd_parse.l18
1 files changed, 16 insertions, 2 deletions
diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l
index b37b8d6944..38a905b4ef 100644
--- a/epan/dtd_parse.l
+++ b/epan/dtd_parse.l
@@ -74,12 +74,20 @@
{NULL,NULL}
};
+#ifdef DEBUG_DTD_PARSER
+#define DEBUG_DTD_TOKEN fprintf(stderr,"->%s (%i)%s\n",location,token_type,yytext)
+#else
+#define DEBUG_DTD_TOKEN
+#endif
+
#define DTD_PARSE(token_type) \
- { build_data->location = location; \
+ { DEBUG_DTD_TOKEN; \
+ build_data->location = location; \
DtdParse(pParser, (token_type), new_token(yytext), build_data); \
if(build_data->error->len > 0) yyterminate(); \
}
+
#define YY_INPUT(buff,result,max_size) ( (result) = my_yyinput((buff),(max_size)) )
%}
@@ -297,7 +305,11 @@ extern dtd_build_data_t* dtd_parse(GString* s) {
len = input_string->len;
pParser = DtdParseAlloc(g_malloc);
-
+
+#ifdef DEBUG_DTD_PARSER
+ DtdParseTrace(stderr, ">>");
+#endif
+
build_data = g_malloc(sizeof(dtd_build_data_t));
build_data->proto_name = NULL;
@@ -322,6 +334,8 @@ extern dtd_build_data_t* dtd_parse(GString* s) {
yyrestart(NULL);
+ location = NULL;
+
DtdParseFree(pParser, g_free );
return build_data;