From: Doyoun Kang <doyoun.kang@samsung.com>
authorDoyoun Kang <doyoun.kang@samsung.com>
Thu, 3 Nov 2011 10:54:33 +0000 (10:54 +0000)
committerCarsten Haitzler <raster@rasterman.com>
Thu, 3 Nov 2011 10:54:33 +0000 (10:54 +0000)
Subject: [E-devel] [Patch] e_config config save patch

I found a problem in e_config. There is no code to check file size when the e makes the
configuration backup files. Even if the file size is 0, the e copies it to backup file.
So, I added code to check the size of the file. Please check the attached patch file.

SVN revision: 64684

AUTHORS
src/bin/e_config.c

diff --git a/AUTHORS b/AUTHORS
index 6b35c02..5aae21e 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -29,3 +29,4 @@ yoz (Michael Bouchaud) <michael.bouchaud@gmail.com>
 billiob (Boris Faure) <billiob@gmail.com>
 Jihoon Kim <jihoon48.kim@samsung.com>
 Sthitha <iamsthitha@gmail>
+Doyoun Kang <doyoun.kang@samsung.com>
index 3592bf8..c08a018 100644 (file)
@@ -1660,7 +1660,8 @@ e_config_profile_save(void)
                     {
                        e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/profile.%i.cfg", i - 1);
                        e_user_dir_snprintf(bdst, sizeof(bdst), "config/profile.%i.cfg", i);
-                       if (ecore_file_exists(bsrc))
+                       if ((ecore_file_exists(bsrc)) &&
+                           (!ecore_file_size(bsrc)))
                          {
                             ret = ecore_file_mv(bsrc, bdst);
                             if (!ret)
@@ -1732,7 +1733,11 @@ e_config_domain_save(const char *domain, E_Config_DD *edd, const void *data)
                     {
                        e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/%s/%s.%i.cfg", _e_config_profile, domain, i - 1);
                        e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.%i.cfg", _e_config_profile, domain, i);
-                       ecore_file_mv(bsrc, bdst);
+                       if ((ecore_file_exists(bsrc)) &&
+                           (!ecore_file_size(bsrc)))
+                         {
+                            ecore_file_mv(bsrc, bdst);
+                         }
                     }
                   e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/%s/%s.cfg", _e_config_profile, domain);
                   e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.1.cfg", _e_config_profile, domain);