2001-08-20 Dave Peticolas <dave@krondo.com>

* src/engine/gnc-book-p.h: add const

	* src/engine/gnc-book.c: strdup error message for backend

	* src/backend/file/gnc-backend-file.c: fix bugs


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5202 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-08-20 08:43:41 +00:00
parent 8ec0225691
commit 5658ec9890
4 changed files with 21 additions and 10 deletions

View File

@ -1,3 +1,11 @@
2001-08-20 Dave Peticolas <dave@krondo.com>
* src/engine/gnc-book-p.h: add const
* src/engine/gnc-book.c: strdup error message for backend
* src/backend/file/gnc-backend-file.c: fix bugs
2001-08-19 Christian Stimming <stimming@tuhh.de>
* po/gnc-glossary.txt, po/glossary/gnc-glossary.txt,

View File

@ -62,9 +62,10 @@ static void
file_book_begin(Backend *be_start, GNCBook *book, const char *book_id,
gboolean ignore_lock, gboolean create_if_nonexistent)
{
FileBackend* be;
char *dirname;
char *p;
FileBackend* be;
ENTER (" ");
be = (FileBackend*)be_start;
@ -73,7 +74,7 @@ file_book_begin(Backend *be_start, GNCBook *book, const char *book_id,
/* Make sure the directory is there */
dirname = g_strdup (book->fullpath);
be->fullpath = book->fullpath;
be->fullpath = g_strdup (book->fullpath);
p = strrchr (dirname, '/');
if (p && p != dirname)
{

View File

@ -95,7 +95,8 @@ void gnc_book_set_pricedb(GNCBook *book, GNCPriceDB *db);
void gnc_book_mark_saved(GNCBook *book);
void gnc_book_push_error (GNCBook *book, GNCBackendError err, char *message);
void gnc_book_push_error (GNCBook *book, GNCBackendError err,
const char *message);
Backend* gncBackendInit_file(const char *book_id, void *data);

View File

@ -66,18 +66,19 @@ static void
gnc_book_clear_error (GNCBook *book)
{
book->last_err = ERR_BACKEND_NO_ERR;
if(book->error_message)
{
g_free(book->error_message);
book->error_message = NULL;
}
g_free(book->error_message);
book->error_message = NULL;
}
void
gnc_book_push_error (GNCBook *book, GNCBackendError err, char *message)
gnc_book_push_error (GNCBook *book, GNCBackendError err, const char *message)
{
if (!book) return;
g_free (book->error_message);
book->last_err = err;
book->error_message = message;
book->error_message = g_strdup (message);
}
GNCBackendError