Improved context handling, to allow elements out of context.
[gedcom-parse.git] / gom / personal_name.c
index 686422fc3b88f2e8a228ee95e464fd2d9d72ca29..02de333272d2f58cbcb171eb7c726ec554093c67 100644 (file)
@@ -47,11 +47,12 @@ Gedcom_ctxt sub_name_start(_ELT_PARAMS_)
        free(name);
       }
       else {
-       switch (ctxt->ctxt_type) {
+       int type = ctxt_type(ctxt);
+       switch (type) {
          case REC_INDI:
            ADDFUNC2(individual,personal_name)(ctxt, name); break;
          default:
-           UNEXPECTED_CONTEXT(ctxt->ctxt_type);
+           UNEXPECTED_CONTEXT(type);
        }
        result = MAKE_GOM_CTXT(elt, personal_name, name);
       }