dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7f9f08f
)
Correct sub_note_end callback: parsed value can be NULL.
author
Peter Verthez
<Peter.Verthez@advalvas.be>
Sat, 25 Jan 2003 18:48:57 +0000
(18:48 +0000)
committer
Peter Verthez
<Peter.Verthez@advalvas.be>
Sat, 25 Jan 2003 18:48:57 +0000
(18:48 +0000)
gom/note_sub.c
patch
|
blob
|
history
diff --git
a/gom/note_sub.c
b/gom/note_sub.c
index 2ff76db751e6eca2b62c999a446037e6e877d837..e523b32ba120dc0cece1800f11f24642d0922180 100644
(file)
--- a/
gom/note_sub.c
+++ b/
gom/note_sub.c
@@
-110,10
+110,29
@@
Gedcom_ctxt sub_note_start(_ELT_PARAMS_)
return (Gedcom_ctxt)result;
}
return (Gedcom_ctxt)result;
}
+void sub_note_end(_ELT_END_PARAMS_)
+{
+ if (GEDCOM_IS_STRING(parsed_value)) {
+ Gom_ctxt ctxt = (Gom_ctxt)self;
+ if (! ctxt)
+ NO_CONTEXT;
+ else {
+ struct note_sub *obj = SAFE_CTXT_CAST(note_sub, ctxt);
+ if (obj) {
+ char *str = GEDCOM_STRING(parsed_value);
+ char *newvalue = strdup(str);
+ if (! newvalue)
+ MEMORY_ERROR;
+ else
+ obj->text = newvalue;
+ }
+ destroy_gom_ctxt(ctxt);
+ }
+ }
+}
+
DEFINE_SUB_MAKEFUNC(note_sub)
DEFINE_SUB_MAKEFUNC(note_sub)
-DEFINE_STRING_END_CB(note_sub, sub_note_end, text)
-
DEFINE_ADDFUNC2(note_sub, source_citation, citation)
DEFINE_ADDFUNC2(note_sub, user_data, extra)
DEFINE_ADDFUNC2(note_sub, source_citation, citation)
DEFINE_ADDFUNC2(note_sub, user_data, extra)