From b516fb6bb1067371a1dc75044cb1a80880839fcd Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Thu, 3 Nov 2011 10:54:33 +0000 Subject: [PATCH] From: Doyoun Kang 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 | 1 + src/bin/e_config.c | 9 +++++++-- 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) billiob (Boris Faure) Jihoon Kim Sthitha +Doyoun Kang 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) { 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);