summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2013-01-31 12:40:19 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2013-01-31 12:40:19 (GMT)
commit07d7e7edfc182082af61756ac31171bf76298a8c (patch)
treef7734dbbbea7434ccb33f73b23d9b9804a4e62c4
parent55dbd5a167d7fccd2ca8a67de8ce24543a5a8d3b (diff)
downloadvdr-plugin-eepg-07d7e7edfc182082af61756ac31171bf76298a8c.tar.gz
vdr-plugin-eepg-07d7e7edfc182082af61756ac31171bf76298a8c.tar.bz2
fix creating of new theme file if missing in eepg dir
-rw-r--r--eepg.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/eepg.c b/eepg.c
index 6f9e6a7..6bf997a 100644
--- a/eepg.c
+++ b/eepg.c
@@ -3446,6 +3446,7 @@ cPluginEEPG::cPluginEEPG (void)
void cPluginEEPG::CheckCreateFile(const char* Name, const char *fileContent[])
{
FILE *File;
+ bool isSkyTheme = fileContent == SkyItThemes || fileContent == SkyUkThemes;
string FileName = string(cSetupEEPG::getInstance()->getConfDir()) + "/" + Name;
File = fopen(FileName.c_str(), "r");
if (File == NULL) {
@@ -3454,11 +3455,23 @@ void cPluginEEPG::CheckCreateFile(const char* Name, const char *fileContent[])
if (File == NULL) {
LogE (0, prep("Error creating file '%s', %s"), FileName.c_str(), strerror (errno));
} else {
- int i = 0;
- while (fileContent[i] != NULL) {
- fprintf (File, "%s\n", fileContent[i]);
- i++;
+ if (!isSkyTheme) {
+ int i = 0;
+ while (fileContent[i] != NULL) {
+ fprintf (File, "%s\n", fileContent[i]);
+ i++;
+ }
+ } else {
+ for (int i = 0; i < 256; i++) {
+ if (fileContent[i]) {
+ fprintf (File, "0x%02x=%s\n", i, fileContent[i]);
+ }
+ else {
+ fprintf (File, "0x%02x=\n", i);
+ }
+ }
}
+
LogI (0, prep("Success creating file '%s'"), FileName.c_str());
fclose (File);
}