[gnome-commander] Do not load devices if devices file does not exist



commit 3c82ee97eace6244a495df2eca82712f91488793
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Tue Sep 27 22:17:24 2016 +0200

    Do not load devices if devices file does not exist

 src/gnome-cmd-data.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 6668cf6..2fdad16 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2189,6 +2189,13 @@ static gboolean load_devices_old (const gchar *fname)
     string line;
     int i = 0;
 
+    //Device file does not exist
+    if(f.fail())
+    {
+        g_free (path);
+        return FALSE;
+    }
+
     while (getline(f,line))
     {
         /* Is the file using the new storage format? If yes, stop here
@@ -2225,6 +2232,7 @@ static gboolean load_devices_old (const gchar *fname)
 
     load_vfs_auto_devices ();
     save_devices_old ("devices.deprecated");
+    save_devices ("devices");
     return TRUE;
 }
 


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