summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoyoun Kang <doyoun.kang@samsung.com>2011-11-03 10:54:33 +0000
committerCarsten Haitzler <raster@rasterman.com>2011-11-03 10:54:33 +0000
commitb516fb6bb1067371a1dc75044cb1a80880839fcd (patch)
treeaa34815b63982894a388d26bf5f74322ef7db619
parent57e79e79eab57c2045e03174aafb50d0eaa31363 (diff)
From: Doyoun Kang <doyoun.kang@samsung.com>
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
-rw-r--r--AUTHORS1
-rw-r--r--src/bin/e_config.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 6b35c0282..5aae21e66 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -29,3 +29,4 @@ yoz (Michael Bouchaud) <michael.bouchaud@gmail.com>
29billiob (Boris Faure) <billiob@gmail.com> 29billiob (Boris Faure) <billiob@gmail.com>
30Jihoon Kim <jihoon48.kim@samsung.com> 30Jihoon Kim <jihoon48.kim@samsung.com>
31Sthitha <iamsthitha@gmail> 31Sthitha <iamsthitha@gmail>
32Doyoun Kang <doyoun.kang@samsung.com>
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 3592bf886..c08a01830 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -1660,7 +1660,8 @@ e_config_profile_save(void)
1660 { 1660 {
1661 e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/profile.%i.cfg", i - 1); 1661 e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/profile.%i.cfg", i - 1);
1662 e_user_dir_snprintf(bdst, sizeof(bdst), "config/profile.%i.cfg", i); 1662 e_user_dir_snprintf(bdst, sizeof(bdst), "config/profile.%i.cfg", i);
1663 if (ecore_file_exists(bsrc)) 1663 if ((ecore_file_exists(bsrc)) &&
1664 (!ecore_file_size(bsrc)))
1664 { 1665 {
1665 ret = ecore_file_mv(bsrc, bdst); 1666 ret = ecore_file_mv(bsrc, bdst);
1666 if (!ret) 1667 if (!ret)
@@ -1732,7 +1733,11 @@ e_config_domain_save(const char *domain, E_Config_DD *edd, const void *data)
1732 { 1733 {
1733 e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/%s/%s.%i.cfg", _e_config_profile, domain, i - 1); 1734 e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/%s/%s.%i.cfg", _e_config_profile, domain, i - 1);
1734 e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.%i.cfg", _e_config_profile, domain, i); 1735 e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.%i.cfg", _e_config_profile, domain, i);
1735 ecore_file_mv(bsrc, bdst); 1736 if ((ecore_file_exists(bsrc)) &&
1737 (!ecore_file_size(bsrc)))
1738 {
1739 ecore_file_mv(bsrc, bdst);
1740 }
1736 } 1741 }
1737 e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/%s/%s.cfg", _e_config_profile, domain); 1742 e_user_dir_snprintf(bsrc, sizeof(bsrc), "config/%s/%s.cfg", _e_config_profile, domain);
1738 e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.1.cfg", _e_config_profile, domain); 1743 e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.1.cfg", _e_config_profile, domain);