diff options
author | louis <louis.braun@gmx.de> | 2015-06-13 15:05:07 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2015-06-13 15:05:07 +0200 |
commit | 745fa9e985d0de8c74a96b79f77ff3c9d11d1faa (patch) | |
tree | c60604b3adfd79bee4308fdb43c76183fde14b89 /libtemplate/templatefunction.c | |
parent | ffca82a8831616e4f9abda8f2d491c26671c3b93 (diff) | |
download | vdr-plugin-skindesigner-745fa9e985d0de8c74a96b79f77ff3c9d11d1faa.tar.gz vdr-plugin-skindesigner-745fa9e985d0de8c74a96b79f77ff3c9d11d1faa.tar.bz2 |
fixed bug in parsing printf text tokens
Diffstat (limited to 'libtemplate/templatefunction.c')
-rw-r--r-- | libtemplate/templatefunction.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libtemplate/templatefunction.c b/libtemplate/templatefunction.c index b2bad34..6c6ae5c 100644 --- a/libtemplate/templatefunction.c +++ b/libtemplate/templatefunction.c @@ -991,14 +991,13 @@ void cTemplateFunction::ParseTextToken(string &value, size_t start, size_t end) value = value.replace(0, start, "");
token.type = ttConstString;
token.value = constString;
- textTokens.push_back(token);
} else {
string tokenName = value.substr(1, end - start - 1);
value = value.replace(0, end - start + 1, "");
token.type = ttToken;
token.value = tokenName;
- textTokens.push_back(token);
}
+ textTokens.push_back(token);
}
void cTemplateFunction::ParseConditionalTextToken(string &value, size_t start, size_t end) {
@@ -1008,7 +1007,6 @@ void cTemplateFunction::ParseConditionalTextToken(string &value, size_t start, s value = value.replace(0, start, "");
token.type = ttConstString;
token.value = constString;
- textTokens.push_back(token);
} else {
string condToken = value.substr(start + 1, end - start - 1);
value = value.replace(0, end - start + 1, "");
@@ -1041,9 +1039,8 @@ void cTemplateFunction::ParseConditionalTextToken(string &value, size_t start, s token.type = ttConditionalToken;
token.value = tokenName;
token.subTokens = subTokens;
- textTokens.push_back(token);
}
-
+ textTokens.push_back(token);
}
void cTemplateFunction::ParsePrintfTextToken(string &value, size_t start, size_t end) {
@@ -1053,7 +1050,6 @@ void cTemplateFunction::ParsePrintfTextToken(string &value, size_t start, size_t value = value.replace(0, start, "");
token.type = ttConstString;
token.value = constString;
- textTokens.push_back(token);
} else {
token.type = ttPrintfToken;
//fetch parameter list from printf
@@ -1814,14 +1810,14 @@ void cTemplateFunction::Debug(void) { eTextTokenType tokenType = (*it).type;
string tokType = "";
if (tokenType == ttConstString)
- tokType = "Const: ";
+ tokType = "Const";
else if (tokenType == ttToken)
- tokType = "Token: ";
+ tokType = "Token";
else if (tokenType == ttConditionalToken)
- tokType = "Conditional Token: ";
+ tokType = "Conditional Token";
else if (tokenType == ttPrintfToken)
- tokType = "PrintF Token: ";
- esyslog("skindesigner: %s %d = \"%s\"", tokType.c_str(), i++, (*it).value.c_str());
+ tokType = "PrintF Token";
+ esyslog("skindesigner: Token %d Type %s : \"%s\"", i++, tokType.c_str(), (*it).value.c_str());
if (tokenType == ttConditionalToken) {
for (vector<cTextToken>::iterator it2 = (*it).subTokens.begin(); it2 != (*it).subTokens.end(); it2++) {
eTextTokenType tokenTypeCond = (*it2).type;
@@ -1835,7 +1831,7 @@ void cTemplateFunction::Debug(void) { }
if (tokenType == ttPrintfToken) {
for (vector<string>::iterator it2 = (*it).parameters.begin(); it2 != (*it).parameters.end(); it2++) {
- esyslog("skindesigner: Printf parameter: %s", (*it2).c_str());
+ esyslog("skindesigner: PrintF parameter: %s", (*it2).c_str());
}
}
}
|