[Gnucash-changes] Provide an error message if the file can't be written.

David Hampton hampton at cvs.gnucash.org
Mon Jun 6 23:21:53 EDT 2005


Log Message:
-----------
Provide an error message if the file can't be written.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/backend/qsf:
        qsf-backend.c

Revision Data
-------------
Index: qsf-backend.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/qsf/Attic/qsf-backend.c,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -Lsrc/backend/qsf/qsf-backend.c -Lsrc/backend/qsf/qsf-backend.c -u -r1.1.2.11 -r1.1.2.12
--- src/backend/qsf/qsf-backend.c
+++ src/backend/qsf/qsf-backend.c
@@ -664,12 +664,16 @@
 
 	qsf_be = (QSFBackend*)be;
 	/* if fullpath is blank, book_id was set to QOF_STDOUT */
-	if (!qsf_be->fullpath || (0 == safe_strcmp(qsf_be->fullpath, ""))) {
+	if (!qsf_be->fullpath || (*qsf_be->fullpath == '\0')) {
 		write_qsf_to_stdout(book);
 		return;
 	}
 	path = strdup(qsf_be->fullpath);
 	out = fopen(path, "w");
+	if (!out) {
+		qof_backend_set_error(be, ERR_FILEIO_WRITE_ERROR);
+		return;
+	}
 	write_qsf_from_book(out, book);
 	g_free(path);
 	fclose(out);


More information about the gnucash-changes mailing list