[almanah] VFS: Avoid to backup DB if file doesn't exists



commit c5aaa81dfae3ac2794f568aa1bfc61777aba6c62
Author: Álvaro Peña <alvaropg gmail com>
Date:   Sun Mar 15 19:00:17 2015 +0100

    VFS: Avoid to backup DB if file doesn't exists

 src/vfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/vfs.c b/src/vfs.c
index d0b0b08..d387c92 100644
--- a/src/vfs.c
+++ b/src/vfs.c
@@ -1012,7 +1012,7 @@ almanah_vfs_open (__attribute__ ((unused)) sqlite3_vfs *pVfs,
                        }
                } else {
                        /* Make a backup of the plaintext database file */
-                       if (back_up_file (self->plain_filename) != TRUE) {
+                       if (g_file_test (self->encrypted_filename, G_FILE_TEST_IS_REGULAR) == TRUE && 
back_up_file (self->plain_filename) != TRUE) {
                                /* Translators: the first parameter is a filename. */
                                g_warning (_("Error backing up file ‘%s’"), self->plain_filename);
                                g_clear_error (&child_error);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]