Fix #103 semicolon with empty command causes problems
| | |
| | | context->buffer.position -= totcmdlen; |
| | | totcmdlen = 0; |
| | | } else { |
| | | if (context->parser_state.programHeader.type == SCPI_TOKEN_UNKNOWN) break; |
| | | if (context->parser_state.programHeader.type == SCPI_TOKEN_UNKNOWN |
| | | && context->parser_state.termination == SCPI_MESSAGE_TERMINATION_NONE) break; |
| | | if (totcmdlen >= context->buffer.position) break; |
| | | } |
| | | } |
| | |
| | | TEST_INPUT("\r\n", "MA,IN,0,VER\r\n"); |
| | | output_buffer_clear(); |
| | | |
| | | /* Test empty command at the beggining */ |
| | | TEST_INPUT(";*IDN?\r\n", "MA,IN,0,VER\r\n"); |
| | | output_buffer_clear(); |
| | | |
| | | TEST_INPUT(";", ""); |
| | | TEST_INPUT("*IDN?\r\n", "MA,IN,0,VER\r\n"); |
| | | output_buffer_clear(); |
| | | |
| | | /* Test input "timeout" - input with length == 0 */ |
| | | TEST_INPUT("*IDN?", ""); |
| | | TEST_INPUT("", "MA,IN,0,VER\r\n"); |