fix fopen mode for binary files - I'm starting to think that shaver, coop, and mccabe are doing this to me on purpose :)
git-svn-id: svn://10.0.0.236/trunk@23120 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
262e661621
commit
073ee50abb
@ -437,6 +437,7 @@ xpidl_process_idl(char *filename, IncludePathEntry *include_path,
|
||||
int rv;
|
||||
struct input_callback_stack stack;
|
||||
gboolean ok;
|
||||
char *fopen_mode;
|
||||
|
||||
stack.includes = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
if (!stack.includes) {
|
||||
@ -490,7 +491,8 @@ xpidl_process_idl(char *filename, IncludePathEntry *include_path,
|
||||
}
|
||||
if (strcmp(outname, "-")) {
|
||||
mode_outname = g_strdup_printf("%s.%s", outname, mode->suffix);
|
||||
state.file = fopen(mode_outname, "w");
|
||||
fopen_mode = mode->factory == xpidl_typelib_dispatch ? "wb" : "w";
|
||||
state.file = fopen(mode_outname, fopen_mode);
|
||||
free(mode_outname);
|
||||
if (!state.file) {
|
||||
perror("error opening output file");
|
||||
|
||||
@ -437,6 +437,7 @@ xpidl_process_idl(char *filename, IncludePathEntry *include_path,
|
||||
int rv;
|
||||
struct input_callback_stack stack;
|
||||
gboolean ok;
|
||||
char *fopen_mode;
|
||||
|
||||
stack.includes = g_hash_table_new(g_str_hash, g_str_equal);
|
||||
if (!stack.includes) {
|
||||
@ -490,7 +491,8 @@ xpidl_process_idl(char *filename, IncludePathEntry *include_path,
|
||||
}
|
||||
if (strcmp(outname, "-")) {
|
||||
mode_outname = g_strdup_printf("%s.%s", outname, mode->suffix);
|
||||
state.file = fopen(mode_outname, "w");
|
||||
fopen_mode = mode->factory == xpidl_typelib_dispatch ? "wb" : "w";
|
||||
state.file = fopen(mode_outname, fopen_mode);
|
||||
free(mode_outname);
|
||||
if (!state.file) {
|
||||
perror("error opening output file");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user