diff options
author | Dimitar Petrovski <dimeptr@gmail.com> | 2013-01-31 13:40:19 +0100 |
---|---|---|
committer | Dimitar Petrovski <dimeptr@gmail.com> | 2013-01-31 13:40:19 +0100 |
commit | 07d7e7edfc182082af61756ac31171bf76298a8c (patch) | |
tree | f7734dbbbea7434ccb33f73b23d9b9804a4e62c4 | |
parent | 55dbd5a167d7fccd2ca8a67de8ce24543a5a8d3b (diff) | |
download | vdr-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.c | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -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); } |