bugfix - now stdin returns 0 if the heredoc body is empty
This commit is contained in:
@@ -486,9 +486,16 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle,
|
||||
inst->stdinIdx ++;
|
||||
}
|
||||
/** -# calculate length and terminate stdin string */
|
||||
inst->stdinLength = inst->lastNewlineIdx - inst->stdinIdx;
|
||||
inst->buffer[inst->lastNewlineIdx] = '\0';
|
||||
|
||||
if(inst->stdinIdx < inst->lastNewlineIdx)
|
||||
{
|
||||
inst->stdinLength = inst->lastNewlineIdx - inst->stdinIdx;
|
||||
inst->buffer[inst->lastNewlineIdx] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
inst->stdinLength = 0u;
|
||||
}
|
||||
|
||||
/** -# calculate length and terminate argument string */
|
||||
inst->inputCount = inst->hereStartIdx;
|
||||
inst->buffer[inst->hereStartIdx] = '\0';
|
||||
|
Reference in New Issue
Block a user