Use binary mode with fopen()

This commit is contained in:
Yevgen Muntyan 2007-12-11 06:36:03 -06:00
parent e3423719fa
commit e2e10f33d8
11 changed files with 13 additions and 13 deletions

View File

@ -729,7 +729,7 @@ moo_app_python_run_file (MooApp *app,
g_return_val_if_fail (filename != NULL, FALSE);
g_return_val_if_fail (moo_python_running (), FALSE);
file = _moo_fopen (filename, "r");
file = _moo_fopen (filename, "rb");
g_return_val_if_fail (file != NULL, FALSE);
res = moo_python_run_file (file, filename, NULL, NULL);

View File

@ -1009,7 +1009,7 @@ get_options_from_file (MooCommandFactory *factory,
FILE *file;
char buf[2048];
if (!(file = g_fopen (filename, "r")))
if (!(file = g_fopen (filename, "rb")))
{
g_warning ("%s: could not open file %s", G_STRFUNC, filename);
return;

View File

@ -281,7 +281,7 @@ cmpl_data_read_python_file (CmplData *data)
if (!moo_python_running ())
return;
file = _moo_fopen (data->path, "r");
file = _moo_fopen (data->path, "rb");
g_return_if_fail (file != NULL);
dict = moo_python_create_script_dict ("__completion_module__");

View File

@ -56,11 +56,11 @@ writelog (const char *format, ...)
if (been_here)
{
logfile = fopen (LOGFILE, "a+");
logfile = fopen (LOGFILE, "ab+");
}
else
{
logfile = fopen (LOGFILE, "w+");
logfile = fopen (LOGFILE, "wb+");
been_here = 1;
}

View File

@ -877,12 +877,12 @@ print_func_file (const char *string)
if (!moo_log_file_written)
{
file = fopen (moo_log_file, "w+");
file = fopen (moo_log_file, "wb+");
moo_log_file_written = TRUE;
}
else
{
file = fopen (moo_log_file, "a+");
file = fopen (moo_log_file, "ab+");
}
if (file)

View File

@ -452,7 +452,7 @@ xdg_mime_get_mime_type_for_file (const char *file_name,
if (data == NULL)
return XDG_MIME_TYPE_UNKNOWN;
file = fopen (file_name, "r");
file = fopen (file_name, "rb");
if (file == NULL)
{
free (data);

View File

@ -120,7 +120,7 @@ _xdg_mime_alias_read_from_file (XdgAliasList *list,
char line[255];
int alloc;
file = fopen (file_name, "r");
file = fopen (file_name, "rb");
if (file == NULL)
return;

View File

@ -713,7 +713,7 @@ _xdg_mime_cache_get_mime_type_for_file (const char *file_name,
if (data == NULL)
return XDG_MIME_TYPE_UNKNOWN;
file = fopen (file_name, "r");
file = fopen (file_name, "rb");
if (file == NULL)
{
free (data);

View File

@ -521,7 +521,7 @@ _xdg_mime_glob_read_from_file (XdgGlobHash *glob_hash,
FILE *glob_file;
char line[255];
glob_file = fopen (file_name, "r");
glob_file = fopen (file_name, "rb");
if (glob_file == NULL)
return;

View File

@ -808,7 +808,7 @@ _xdg_mime_magic_read_from_file (XdgMimeMagic *mime_magic,
FILE *magic_file;
char header[12];
magic_file = fopen (file_name, "r");
magic_file = fopen (file_name, "rb");
if (magic_file == NULL)
return;

View File

@ -126,7 +126,7 @@ _xdg_mime_parent_read_from_file (XdgParentList *list,
int i, alloc;
XdgMimeParents *entry;
file = fopen (file_name, "r");
file = fopen (file_name, "rb");
if (file == NULL)
return;