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
cb9be964
Commit
cb9be964
authored
Mar 30, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Move temp file management from wpp directly into the load_file function.
parent
74ad854e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
wrc.c
tools/wrc/wrc.c
+26
-16
No files found.
tools/wrc/wrc.c
View file @
cb9be964
...
...
@@ -256,40 +256,50 @@ static int load_file( const char *input_name, const char *output_name )
/* Run the preprocessor on the input */
if
(
!
no_preprocess
)
{
FILE
*
output
;
int
ret
,
fd
;
char
*
name
;
/*
* Preprocess the input to a temp-file, or stdout if
* no output was given.
*/
chat
(
"Starting preprocess
\n
"
);
if
(
!
preprocess_only
)
if
(
preprocess_only
)
{
ret
=
wpp_parse_temp
(
input_name
,
output_name
,
&
temp_name
);
}
else
if
(
output_name
)
if
(
output_name
)
{
FILE
*
output
;
if
(
!
(
output
=
fopen
(
output_name
,
"w"
)))
fatal_perror
(
"Could not open %s for writing"
,
output_name
);
ret
=
wpp_parse
(
input_name
,
output
);
fclose
(
output
);
}
else
{
ret
=
wpp_parse
(
input_name
,
stdout
);
}
else
ret
=
wpp_parse
(
input_name
,
stdout
);
if
(
ret
)
return
ret
;
if
(
preprocess_only
)
{
output_name
=
NULL
;
exit
(
0
);
}
input_name
=
temp_name
;
if
(
output_name
&&
output_name
[
0
])
{
name
=
xmalloc
(
strlen
(
output_name
)
+
8
);
strcpy
(
name
,
output_name
);
strcat
(
name
,
".XXXXXX"
);
}
else
name
=
xstrdup
(
"wrc.XXXXXX"
);
if
((
fd
=
mkstemps
(
name
,
0
))
==
-
1
)
error
(
"Could not generate a temp name from %s
\n
"
,
name
);
temp_name
=
name
;
if
(
!
(
output
=
fdopen
(
fd
,
"wt"
)))
error
(
"Could not open fd %s for writing
\n
"
,
name
);
ret
=
wpp_parse
(
input_name
,
output
);
fclose
(
output
);
if
(
ret
)
return
ret
;
input_name
=
name
;
}
/* Reset the language */
...
...
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