From c3c1b2e0f9c3c9e93eec54d5f7cf3e3b74e1c86f Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Mon, 25 Aug 2008 05:11:20 -0500 Subject: [PATCH] Corrected a brain dead logic error which led to data loss --- moo/mooedit/mooeditfileops.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/moo/mooedit/mooeditfileops.c b/moo/mooedit/mooeditfileops.c index 50bb3452..ae2d2280 100644 --- a/moo/mooedit/mooeditfileops.c +++ b/moo/mooedit/mooeditfileops.c @@ -759,13 +759,16 @@ do_save_local (MooEdit *edit, if ((*error)->domain != G_CONVERT_ERROR || _moo_encodings_equal (encoding, MOO_ENCODING_UTF8)) { - g_clear_error (error); + *retval = FALSE; + return FALSE; + } - if (!do_write (edit, filename, MOO_ENCODING_UTF8, error)) - { - *retval = FALSE; - return FALSE; - } + g_clear_error (error); + + if (!do_write (edit, filename, MOO_ENCODING_UTF8, error)) + { + *retval = FALSE; + return FALSE; } *retval = FALSE;