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
This commit is contained in:
Doyoun Kang 2011-11-03 10:54:33 +00:00 committed by Carsten Haitzler
parent 57e79e79ea
commit b516fb6bb1
2 changed files with 8 additions and 2 deletions

View File

@ -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>

View 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);