Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3b12583d
Commit
3b12583d
authored
Mar 20, 2024
by
Jacek Caban
Committed by
Alexandre Julliard
Mar 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Always close parsed input file.
Fixes a regression from
9d537999
, which removed closing the file. This causes Windows widl build to be to remove the temporary file on exit.
parent
6ce8a31b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
8 deletions
+15
-8
parser.h
tools/widl/parser.h
+1
-0
parser.l
tools/widl/parser.l
+10
-2
parser.y
tools/widl/parser.y
+2
-2
widl.c
tools/widl/widl.c
+2
-4
No files found.
tools/widl/parser.h
View file @
3b12583d
...
...
@@ -42,5 +42,6 @@ int is_warning_enabled(int warning);
extern
char
*
find_input_file
(
const
char
*
name
,
const
char
*
parent
);
extern
FILE
*
open_input_file
(
const
char
*
path
);
extern
void
close_all_inputs
(
void
);
#endif
tools/widl/parser.l
View file @
3b12583d
...
...
@@ -481,10 +481,11 @@ static void print_imports(void)
fprintf( stderr, "%s:%d:\n", state->input_name, state->where.first_line );
}
void pop_import( struct location *where
)
struct location pop_import(void
)
{
struct list *entry = list_head( &import_stack );
struct import_state *state;
struct location where;
assert( entry );
state = LIST_ENTRY( entry, struct import_state, entry );
...
...
@@ -496,8 +497,9 @@ void pop_import( struct location *where )
yy_switch_to_buffer( state->buffer );
input_name = state->input_name;
*
where = state->where;
where = state->where;
free( state );
return where;
}
void push_import( const char *import_name, struct location *where )
...
...
@@ -547,6 +549,12 @@ static void switch_to_acf(void)
yy_switch_to_buffer( yy_create_buffer( file, YY_BUF_SIZE ) );
}
void close_all_inputs(void)
{
while (!list_empty( &import_stack )) pop_import();
if (yyin) fclose( yyin );
}
static void reset_location( struct location *where, const char *input_name )
{
where->first_line = 1;
...
...
tools/widl/parser.y
View file @
3b12583d
...
...
@@ -118,7 +118,7 @@ static typelib_t *current_typelib;
int parser_lex( PARSER_STYPE *yylval, PARSER_LTYPE *yylloc );
void push_import( const char *fname, PARSER_LTYPE *yylloc );
void pop_import( PARSER_LTYPE *yylloc
);
PARSER_LTYPE pop_import(void
);
# define YYLLOC_DEFAULT( cur, rhs, n ) \
do { if (n) init_location( &(cur), &YYRHSLOC( rhs, 1 ), &YYRHSLOC( rhs, n ) ); \
...
...
@@ -515,7 +515,7 @@ cppquote: tCPPQUOTE '(' aSTRING ')' { $$ = $3; }
import_start: tIMPORT aSTRING ';' { $$ = $2; push_import( $2, &yylloc ); }
;
import: import_start imp_statements aEOF {
pop_import( &yylloc
); }
import: import_start imp_statements aEOF {
yyloc = pop_import(
); }
;
importlib: tIMPORTLIB '(' aSTRING ')'
...
...
tools/widl/widl.c
View file @
3b12583d
...
...
@@ -843,10 +843,8 @@ int main(int argc,char *argv[])
init_types
();
ret
=
parser_parse
();
if
(
ret
)
{
exit
(
1
);
}
close_all_inputs
();
if
(
ret
)
exit
(
1
);
/* Everything has been done successfully, don't delete any files. */
set_everything
(
FALSE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment