summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-03-30 11:15:41 +0200
committerDanny Baumann <dannybaumann@web.de>2007-03-30 11:15:41 +0200
commit316c3505328f01d64bebeb2d464275067bdec800 (patch)
tree6f6b7ad3a9aedc4b1e24ce1493fbc875292be17b
parent7d76b72bfe6348c01e355840d0b69dc5b2007f1c (diff)
parent4f59c9a6677efa0f42ed9f5d56eb26d9b85ddbbe (diff)
downloadberyl-bcop-master.tar.gz
beryl-bcop-master.tar.bz2
Merge branch 'master' of git+ssh://maniac@git.beryl-project.org/git/beryl/bcopHEADmaster
-rw-r--r--src/xml_parser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xml_parser.c b/src/xml_parser.c
index 5fabf3e..28f84dd 100644
--- a/src/xml_parser.c
+++ b/src/xml_parser.c
@@ -282,10 +282,11 @@ parseEnumOption(xmlDoc *doc, xmlNode *node, Option *set)
}
l = l->next;
}
- if (key && strlen((char *)key) && name && strlen((char *)name))
+ if (name && strlen((char *)name))
{
OptionValuesList *lv = calloc(1,sizeof(OptionValuesList));
- lv->value = strdup((char *)key);
+ lv->value = (key && strlen((char *)key)) ?
+ strdup((char *)key) : strdup((char *)name);
lv->name = strToLower((char *)name);
lv->uName = strToUpper((char *)name);
lv->fUName = strToFirstUp((char *)name);
@@ -349,7 +350,8 @@ parseSelectionOption(xmlDoc *doc, xmlNode *node, Option *set)
if (key && strlen((char *)key) && name && strlen((char *)name))
{
OptionValuesList *lv = calloc(1,sizeof(OptionValuesList));
- lv->value = strdup((char *)key);
+ lv->value = (key && strlen((char *)key)) ?
+ strdup((char *)key) : strdup((char *)name);
lv->name = strToLower((char *)name);
lv->uName = strToUpper((char *)name);
lv->fUName = strToFirstUp((char *)name);