From e3d641dc7f4e4e634267d39cae8dcc597f13bb3a Mon Sep 17 00:00:00 2001 From: Andrey Nakin <andrey.nakin@gmail.com> Date: 周五, 17 4月 2015 03:58:15 +0800 Subject: [PATCH] Merge branch 'master' of https://github.com/j123b567/scpi-parser --- libscpi/src/parser.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/libscpi/src/parser.c b/libscpi/src/parser.c index 3b53665..ecf26ec 100644 --- a/libscpi/src/parser.c +++ b/libscpi/src/parser.c @@ -593,8 +593,10 @@ return FALSE; } + paramSkipWhitespace(context); if (locateText(context->paramlist.parameters, context->paramlist.length, value, &length)) { - paramSkipBytes(context, length); + paramSkipBytes(context, length + 2); + paramSkipWhitespace(context); if (len) { *len = length; } @@ -675,3 +677,11 @@ return FALSE; } +scpi_bool_t SCPI_IsCmd(scpi_t * context, const char * cmd) { + if (! context->paramlist.cmd) { + return FALSE; + } + + const char * pattern = context->paramlist.cmd->pattern; + return matchCommand (pattern, cmd, strlen (cmd)); +} -- Gitblit v1.9.1