Skip to content

Commit

Permalink
Fix return value of gnc_book_write_to_xml_file_v2()
Browse files Browse the repository at this point in the history
81b9a02 changed the behaviour of the
"success" variable that's used for the return value, so now the value is
being repeatedly overwritten instead of being combined with the result of
the next call.

Restore the original behaviour of setting success to false on failure.
  • Loading branch information
nomis committed Jun 24, 2023
1 parent ba7b260 commit 4b83068
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libgnucash/backend/xml/io-gncxml-v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1602,14 +1602,19 @@ gnc_book_write_to_xml_file_v2 (QofBook* book, const char* filename,
return false;

/* Try to write as much as possible */
success = (gnc_book_write_to_xml_filehandle_v2 (book, file));
if (!gnc_book_write_to_xml_filehandle_v2 (book, file))
success = false;

/* Close the output stream */
success = ! (fclose (file));
if (fclose (file))
success = false;

/* Optionally wait for parallel compression threads */
if (thread)
success = g_thread_join (thread) != nullptr;
{
if (g_thread_join (thread) != nullptr)
success = false;
}

return success;
}
Expand Down

0 comments on commit 4b83068

Please sign in to comment.