added the help command variable to the instance structure to get independant commands for each instance fix #42

This commit is contained in:
prozessorkern
2020-03-22 20:07:30 +01:00
parent 2d130e2ee1
commit 5a00f22e31
2 changed files with 6 additions and 2 deletions

View File

@@ -93,12 +93,15 @@ shellmatta_retCode_t shellmatta_doInit(
inst->hereDelimiterIdx = 0u;
inst->hereLength = 0u;
inst->mode = SHELLMATTA_MODE_INSERT;
inst->cmdList = &helpCmd;
inst->cmdList = &(inst->helpCmd);
inst->cmdListIsConst = false;
/*! -# copy the help command structure to this instance */
memcpy(&(inst->helpCmd), &helpCmd, sizeof(shellmatta_cmd_t));
if(NULL != cmdList)
{
helpCmd.next = (shellmatta_cmd_t *) cmdList;
inst->helpCmd.next = (shellmatta_cmd_t *) cmdList;
inst->cmdListIsConst = true;
}