Commit 260b8add authored by npzacs's avatar npzacs
Browse files

Fixed memory leak in lexer

parent 9e39d143
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
- Added aacs_open2() and error codes - Added aacs_open2() and error codes
- Renamed libaacs_test to aacs_info - Renamed libaacs_test to aacs_info
- Added aacs_get_mkb_version() - Added aacs_get_mkb_version()
- Fixed memory leaks
2012-03-21: Version 0.3.1 2012-03-21: Version 0.3.1
- Added configure option for libgcrypt prefix - Added configure option for libgcrypt prefix
......
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
int isatty(int i) { return 0; } int isatty(int i) { return 0; }
#if 0
static char *trim_string(const char *string); static char *trim_string(const char *string);
#endif
%} %}
/* Options to generate reentrant lexer that's POSIX lex compatible. The /* Options to generate reentrant lexer that's POSIX lex compatible. The
* bison-bridge option is also set since bison forces the use of a parameter * bison-bridge option is also set since bison forces the use of a parameter
...@@ -86,7 +88,8 @@ BAD_ENTRY ([^\n]) ...@@ -86,7 +88,8 @@ BAD_ENTRY ([^\n])
{WHITESPACE} {} {WHITESPACE} {}
<TITLE_STATE>{DISC_TITLE} { <TITLE_STATE>{DISC_TITLE} {
yylval->string = trim_string(yytext); //yylval->string = trim_string(yytext);
yylval->string = yytext;
BEGIN INITIAL; BEGIN INITIAL;
return DISC_TITLE; return DISC_TITLE;
} }
...@@ -135,6 +138,7 @@ BAD_ENTRY ([^\n]) ...@@ -135,6 +138,7 @@ BAD_ENTRY ([^\n])
{COMMENT} {} {COMMENT} {}
{BAD_ENTRY} { return BAD_ENTRY; } {BAD_ENTRY} { return BAD_ENTRY; }
%% %%
#if 0
/* Function used to trim leading and trailing space from a string */ /* Function used to trim leading and trailing space from a string */
static char *trim_string(const char *string) static char *trim_string(const char *string)
{ {
...@@ -151,3 +155,4 @@ static char *trim_string(const char *string) ...@@ -151,3 +155,4 @@ static char *trim_string(const char *string)
new_string[size] = '\0'; new_string[size] = '\0';
return new_string; return new_string;
} }
#endif
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment