projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6472fde
)
Fun normalize_record_transform: fix un-init var
author
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 5 May 2010 11:30:45 +0000
(13:30 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Wed, 5 May 2010 11:30:45 +0000
(13:30 +0200)
And reformat a bit.
src/normalize_record.c
patch
|
blob
|
history
diff --git
a/src/normalize_record.c
b/src/normalize_record.c
index
fa39da2
..
5623c33
100644
(file)
--- a/
src/normalize_record.c
+++ b/
src/normalize_record.c
@@
-121,34
+121,35
@@
void normalize_record_destroy(normalize_record_t nt)
}
int normalize_record_transform(normalize_record_t nt, xmlDoc **doc,
}
int normalize_record_transform(normalize_record_t nt, xmlDoc **doc,
- const char **parms)
+ const char **parms)
{
{
- struct normalize_step *m;
- if (nt) {
+ if (nt)
+ {
+ struct normalize_step *m;
for (m = nt->steps; m; m = m->next)
{
xmlNodePtr root = 0;
for (m = nt->steps; m; m = m->next)
{
xmlNodePtr root = 0;
- xmlDoc *new;
+ xmlDoc *ndoc;
if (m->stylesheet)
if (m->stylesheet)
- {
- new = xsltApplyStylesheet(m->stylesheet, *doc, parms);
- }
+ ndoc = xsltApplyStylesheet(m->stylesheet, *doc, parms);
else if (m->marcmap)
else if (m->marcmap)
- {
- new = marcmap_apply(m->marcmap, *doc);
- }
-
- root = xmlDocGetRootElement(new);
-
+ ndoc = marcmap_apply(m->marcmap, *doc);
+ else
+ ndoc = 0;
xmlFreeDoc(*doc);
xmlFreeDoc(*doc);
- if (!new || !root || !root->children)
+ *doc = 0;
+
+ if (ndoc)
+ root = xmlDocGetRootElement(ndoc);
+
+ if (ndoc && root && root->children)
+ *doc = ndoc;
+ else
{
{
- if (new)
- xmlFreeDoc(new);
- *doc = 0;
+ if (ndoc)
+ xmlFreeDoc(ndoc);
return -1;
}
return -1;
}
- *doc = new;
}
}
return 0;
}
}
return 0;