changed heredoc support

now the input string is kept intact until the end of the input is reached
this enables the history buffer to store the complete command
Still broken:
history buffer with heredoc wont execute because the delimiter is not determined correctly
editing of multiline things
This commit is contained in:
prozessorkern
2019-07-30 23:55:12 +02:00
parent 280e512746
commit 16365f341e
3 changed files with 66 additions and 36 deletions

View File

@@ -42,7 +42,7 @@ void set_blocking (int fd, int should_block)
static shellmatta_retCode_t doSomething(shellmatta_handle_t handle, const char *arguments, uint32_t length)
{
shellmatta_printf(handle, "%s - length: %u", arguments, length);
return SHELLMATTA_OK;
}
shellmatta_cmd_t doSomethingCmd = {"doSomething", "do", "Function does something", "use me, please", doSomething, NULL};
@@ -79,7 +79,7 @@ int main(void)
static char historyBuffer[4096];
static shellmatta_instance_t instance;
f = open("/dev/pts/1", O_RDWR | O_SYNC);
f = open("/dev/pts/3", O_RDWR | O_SYNC);
if (f < 0)
{