From 0b52a2f2465a66bcee9ad5b63d11597554e61bb9 Mon Sep 17 00:00:00 2001 From: prozessorkern Date: Wed, 26 Jun 2019 21:54:15 +0200 Subject: [PATCH 1/2] use the right pointer to insert the new command fix #12 --- src/shellmatta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shellmatta.c b/src/shellmatta.c index 97d646e..01e372c 100644 --- a/src/shellmatta.c +++ b/src/shellmatta.c @@ -166,7 +166,7 @@ shellmatta_retCode_t shellmatta_addCmd(shellmatta_handle_t handle, shellmatta_cm { /* nothing to do */ } - prevCmd = &tempCmd; + prevCmd = &(tempCmd->next); tempCmd = tempCmd->next; } } From b71f1afe112a79ce251820c7bd5f84d25b1b47ac Mon Sep 17 00:00:00 2001 From: prozessorkern Date: Wed, 26 Jun 2019 22:00:55 +0200 Subject: [PATCH 2/2] ignore newline as first character fix #13 --- src/shellmatta.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shellmatta.c b/src/shellmatta.c index 01e372c..b183f48 100644 --- a/src/shellmatta.c +++ b/src/shellmatta.c @@ -200,7 +200,6 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle, if( (NULL != inst) && (SHELLMATTA_MAGIC == inst->magic)) { - /** -# process byte wise */ for (uint32_t i = 0u; i < size; i++) { @@ -209,6 +208,12 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle, { escape_handleSequence(inst, *data); } + /** -# ignore newline as first character (to be compatible to + * terminals sending newline after return */ + else if((0u == inst->inputCount) && ('\n' == *data)) + { + /* do nothing */ + } /** -# handle return as start of processing the command */ else if ('\r' == *data) {