Skip to content

Commit 1020d7f

Browse files
committed
vcardparser.c: yet more debugging
1 parent 3abf1fe commit 1020d7f

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Diff for: src/libicalvcard/vcardparser.c

+13-8
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,8 @@ static void _parse_eatline(struct vcardparser_state *state)
796796
static void _parse_prop(struct vcardparser_state *state)
797797
{
798798
int r = _parse_prop_name(state);
799-
fprintf(stderr, "_parse_prop_name: %d '%s'\n", r, state->prop ? vcardproperty_get_property_name(state->prop) : "");
799+
800+
fprintf(stderr, "_parse_prop_name: %d '%s'\n", r, state->prop ? vcardproperty_get_property_name(state->prop) : "");
800801
if (r) {
801802
if (r == PE_PROP_MULTIGROUP) {
802803
vcardproperty_kind prop_kind = vcardproperty_isa(state->prop);
@@ -868,6 +869,7 @@ static int _parse_vcard(struct vcardparser_state *state,
868869
int r = 0;
869870

870871
while (*state->p) {
872+
fprintf(stderr, "p: '%c'\n", *state->p);
871873
/* whitespace is very skippable before AND afterwards */
872874
if (*state->p == '\r' || *state->p == '\n' ||
873875
*state->p == ' ' || *state->p == '\t') {
@@ -915,20 +917,23 @@ fprintf(stderr, "END val: '%s'\n", val);
915917
/* special case mismatched card, the "start" was the start of
916918
* the card */
917919
state->itemstart = cardstart;
918-
fprintf(stderr, "BEGIN comp (%u) != END (%u)\n",
919-
vcardcomponent_isa(comp), kind);
920+
fprintf(stderr, "BEGIN comp (%u) != END (%u)\n",
921+
vcardcomponent_isa(comp), kind);
922+
fprintf(stderr, "cardstart: '%s'\n", cardstart);
920923
r = PE_MISMATCHED_CARD;
921924
}
922925

923926
break;
924927
}
925928
else {
929+
fprintf(stderr, "add prop\n");
926930
vcardcomponent_add_property(comp, state->prop);
927931
state->prop = NULL;
928932
}
929933
}
930934

931935
if (state->prop) {
936+
fprintf(stderr, "end of card\n");
932937
if (vcardproperty_isa(state->prop) != VCARD_END_PROPERTY) {
933938
r = PE_FINISHED_EARLY;
934939
}
@@ -1032,11 +1037,11 @@ vcardcomponent *vcardparser_parse_string(const char *str)
10321037
parser.root = NULL;
10331038
}
10341039
}
1035-
else {
1036-
fprintf(stderr, "vcardparser_parse_string() failed: %s\n%s\n",
1037-
vcardparser_errstr(r),
1038-
vcardcomponent_as_vcard_string(parser.root));
1039-
}
1040+
else {
1041+
fprintf(stderr, "vcardparser_parse_string() failed: %s\n%s\n",
1042+
vcardparser_errstr(r),
1043+
vcardcomponent_as_vcard_string(parser.root));
1044+
}
10401045

10411046
vcardparser_free(&parser);
10421047

0 commit comments

Comments
 (0)