summaryrefslogtreecommitdiff
path: root/eepg.c
diff options
context:
space:
mode:
authorDimitar Petrovski <dimeptr@gmail.com>2013-01-31 13:15:37 (GMT)
committerDimitar Petrovski <dimeptr@gmail.com>2013-01-31 13:15:37 (GMT)
commit2eb5f7d939dd8dbcb560d03bf608e341924b0c2b (patch)
treecb9c18e7f0bcc3c8749922d4e9756d53c93d0d8f /eepg.c
parent1674e7952818c7deb9f826040163e3c30ad3c0ca (diff)
downloadvdr-plugin-eepg-2eb5f7d939dd8dbcb560d03bf608e341924b0c2b.tar.gz
vdr-plugin-eepg-2eb5f7d939dd8dbcb560d03bf608e341924b0c2b.tar.bz2
fix creating of new theme file if missing in eepg dir
Diffstat (limited to 'eepg.c')
-rw-r--r--eepg.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/eepg.c b/eepg.c
index 70a1134..7a7272c 100644
--- a/eepg.c
+++ b/eepg.c
@@ -3466,6 +3466,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) {
@@ -3474,11 +3475,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);
}