Commit d1e33133 authored by Mukund Sivaraman's avatar Mukund Sivaraman Committed by Mukund Sivaraman

properly parse files with CRLF line-endings which were created in the past

2007-04-26  Mukund Sivaraman  <muks@mukund.org>

        * plug-ins/gfig/gfig-dobject.c: properly parse files with CRLF
        line-endings which were created in the past in Windows.

        * plug-ins/gfig/gfig.c: open files in binary mode so that the same
        line-endings are used on all platforms.


svn path=/trunk/; revision=22338
parent 1b9ce30a
2007-04-26 Mukund Sivaraman <muks@mukund.org>
* plug-ins/gfig/gfig-dobject.c: properly parse files with CRLF
line-endings which were created in the past in Windows.
* plug-ins/gfig/gfig.c: open files in binary mode so that the same
line-endings are used on all platforms.
2007-04-25 Michael Natterer <mitch@gimp.org>
* app/core/gimpbrush.c (gimp_brush_scale_size): removed bogus
......@@ -944,6 +944,10 @@ get_line (gchar *buf,
if (slen > 0)
buf[slen - 1] = '\0';
/* Check and remove an '\r' too from Windows */
if ((slen > 1) && (buf[slen - 2] == '\r'))
buf[slen - 2] = '\0';
if (ferror (from))
{
g_warning (_("Error reading file"));
......@@ -1088,4 +1092,3 @@ d_pnt_add_line (GfigObject *obj,
}
}
}
......@@ -428,7 +428,7 @@ gfig_load (const gchar *filename,
printf ("Loading %s (%s)\n", filename, name);
#endif /* DEBUG */
fp = g_fopen (filename, "r");
fp = g_fopen (filename, "rb");
if (!fp)
{
g_message (_("Could not open '%s' for reading: %s"),
......@@ -752,7 +752,7 @@ gfig_load_from_parasite (void)
fname = gimp_temp_name ("gfigtmp");
fp = g_fopen (fname, "w");
fp = g_fopen (fname, "wb");
if (!fp)
{
g_message (_("Error trying to open temporary file '%s' "
......@@ -787,7 +787,7 @@ gfig_save_callbk (void)
savename = gfig_context->current_obj->filename;
fp = g_fopen (savename, "w+");
fp = g_fopen (savename, "wb+");
if (!fp)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment