Only initialize the tokenizer once. It gets cranky if it we call
tok_init more than once.
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
static Cond cmd_cond;
static SimpleMessenger *messenger = 0;
static SafeTimer timer(g.lock);
+static Tokenizer *tok;
static const char *outfile = 0;
int argc;
const char **argv;
- Tokenizer *tok = tok_init(NULL);
tok_str(tok, line, &argc, &argv);
tok_reset(tok);
- tok_end(tok);
vector<string> cmd;
const char *infile = 0;
if (g.mc.build_initial_monmap() < 0)
return -1;
+ // initialize tokenizer
+ tok = tok_init(NULL);
+
// start up network
messenger = new SimpleMessenger();
messenger->register_entity(entity_name_t::CLIENT());
// wait for messenger to finish
messenger->wait();
messenger->destroy();
+ tok_end(tok);
return ret;
}