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:
jband%netscape.com 1999-03-07 20:48:37 +00:00
parent 262e661621
commit 073ee50abb
2 changed files with 6 additions and 2 deletions

View 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");

View 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");