if (chook_tab[i].mush_key != NULL)
sz++;
hashinit(&chook_mevents, sz);
- for (sz = i = 0; chook_tab[i].key != NULL; i++)
+ for (i = 0; chook_tab[i].key != NULL; i++)
if (chook_tab[i].mush_key != NULL)
- hashadd(strupper(chook_tab[i].mush_key), (void *) chook_tab[i].key, &chook_mevents);
+ hashadd(chook_tab[i].mush_key, (void *) chook_tab[i].key, &chook_mevents);
}
struct core_hook_t *
struct core_hook_t *chook;
/* check to see if we need to create it */
- if ((chook = (struct core_hook_t *) hashfind(strupper(key), &chook_htab))) {
+ if ((chook = (struct core_hook_t *) hashfind(key, &chook_htab))) {
/* It already exists.. just return this one */
return chook;
}
chook->flags = flags;
chook->hooks = NULL; /* Initialized as having no children */
/* Add to the hashtab */
- hashadd(strupper(key), chook, &chook_htab);
+ hashadd(key, chook, &chook_htab);
return chook;
}
struct core_entry_t *new_child, *cur_child;
/* Ok first look for the htab entry */
- parent = hashfind(strupper(key), &chook_htab);
+ parent = hashfind(key, &chook_htab);
if (!parent) /* It doesn't exist, return NULL */
return NULL;
softcode_block =
(struct softcode_hook *) mush_malloc(sizeof(struct softcode_hook),
"CHOOK.SOFTCODE_BLOCK");
+ if(!softcode_block)
+ mush_panic("Out of memory");
softcode_block->obj = object;
memset(softcode_block->attribute, '\0', ATTRIBUTE_NAME_LIMIT);
strncpy(softcode_block->attribute, strupper(attribute),
int break_count, spot = 0;
sc_hook = (struct softcode_hook *) entry->data;
+ strcpy(global_eval_context.ccom, "");
/* Before we bother with va_list .. Make sure A) Its a good object, B) Its a good attribute */
if (!GoodObject(sc_hook->obj))
break_count = 100;
start_cpu_timer();
while (!cpu_time_limit_hit && *s) {
- r = cmd_buf;
+ r = global_eval_context.ccom;
local_ooref = ooref;
ooref = atr->creator;
- process_expression(cmd_buf, &r, &s,
+ process_expression(global_eval_context.ccom, &r, &s,
executor, enactor, cause, PE_NOTHING, PT_SEMI, NULL);
*r = '\0';
if (*s == ';')
s++;
- strcpy(tbuf, cmd_buf);
+ strcpy(tbuf, global_eval_context.ccom);
process_command(executor, tbuf, enactor, cause, 0);
if (global_eval_context.break_called) {
global_eval_context.break_called = 0;