mirror of git://git.psyced.org/git/psyclpc
pkg-psyc: fix for parser
This commit is contained in:
parent
a27331f703
commit
62763ffeba
|
@ -127,6 +127,8 @@ f_psyc_parse (svalue_t *sp) {
|
||||||
state = pxalloc(sizeof(psyc_state_t));
|
state = pxalloc(sizeof(psyc_state_t));
|
||||||
if (!state) errorf("Out of memory for psyc state struct.\n");
|
if (!state) errorf("Out of memory for psyc state struct.\n");
|
||||||
O_GET_PSYC_STATE(current_object) = state;
|
O_GET_PSYC_STATE(current_object) = state;
|
||||||
|
memset(state, 0, sizeof(psyc_state_t));
|
||||||
|
|
||||||
state->parser = pxalloc(sizeof(psycParseState));
|
state->parser = pxalloc(sizeof(psycParseState));
|
||||||
if (!state->parser) errorf("Out of memory for psyc parse state struct.\n");
|
if (!state->parser) errorf("Out of memory for psyc parse state struct.\n");
|
||||||
psyc_initParseState(state->parser);
|
psyc_initParseState(state->parser);
|
||||||
|
@ -161,6 +163,7 @@ f_psyc_parse (svalue_t *sp) {
|
||||||
|
|
||||||
if (state->remaining) {
|
if (state->remaining) {
|
||||||
pfree(state->remaining);
|
pfree(state->remaining);
|
||||||
|
state->remaining = NULL;
|
||||||
state->remaining_len = 0;
|
state->remaining_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,6 +270,7 @@ f_psyc_parse (svalue_t *sp) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PSYC_PARSE_COMPLETE:
|
case PSYC_PARSE_COMPLETE:
|
||||||
|
state->packet = NULL;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
case PSYC_PARSE_INSUFFICIENT:
|
case PSYC_PARSE_INSUFFICIENT:
|
||||||
|
|
|
@ -44,6 +44,7 @@ psyc_free_state (psyc_state_t *ps) {
|
||||||
pfree((void *) ps->parser);
|
pfree((void *) ps->parser);
|
||||||
if (ps->packet)
|
if (ps->packet)
|
||||||
free_array(ps->packet);
|
free_array(ps->packet);
|
||||||
|
ps->name = ps->value = ps->remaining = ps->parser = ps->packet = NULL;
|
||||||
ps->oper = ps->name_len = ps->value_len = ps->remaining_len = 0;
|
ps->oper = ps->name_len = ps->value_len = ps->remaining_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ version_longtype="stable"
|
||||||
# A timestamp, to be used by bumpversion and other scripts.
|
# A timestamp, to be used by bumpversion and other scripts.
|
||||||
# It can be used, for example, to 'touch' this file on every build, thus
|
# It can be used, for example, to 'touch' this file on every build, thus
|
||||||
# forcing revision control systems to add it on every checkin automatically.
|
# forcing revision control systems to add it on every checkin automatically.
|
||||||
version_stamp="Mon May 9 21:22:33 CEST 2011"
|
version_stamp="Tue May 10 01:00:33 CEST 2011"
|
||||||
|
|
||||||
# Okay, LDMUD is using 3.x.x so to avoid conflicts let's just use 4.x.x
|
# Okay, LDMUD is using 3.x.x so to avoid conflicts let's just use 4.x.x
|
||||||
version_major=4
|
version_major=4
|
||||||
|
|
Loading…
Reference in New Issue