From 570ba8907a1f98ac235166ea2880d46954927af8 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Wed, 29 Jun 2016 17:31:31 -0400 Subject: [PATCH] Updated mpc_input_new_string to reflect changes in mpc --- mpc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mpc.c b/mpc.c index 535830a..6940d0e 100644 --- a/mpc.c +++ b/mpc.c @@ -142,14 +142,19 @@ static mpc_input_t *mpc_input_new_nstring(const char *filename, const char *stri i->buffer = NULL; i->file = NULL; + i->suppress = 0; i->backtrack = 1; i->marks_num = 0; - i->marks = NULL; - i->lasts = NULL; - + i->marks_slots = MPC_INPUT_MARKS_MIN; + i->marks = malloc(sizeof(mpc_state_t) * i->marks_slots); + i->lasts = malloc(sizeof(char) * i->marks_slots); i->last = '\0'; + i->mem_index = 0; + memset(i->mem_full, 0, sizeof(char) * MPC_INPUT_MEM_NUM); + return i; + } static mpc_input_t *mpc_input_new_pipe(const char *filename, FILE *pipe) {