mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
Merge branch 'master' into smartcard-relay
This commit is contained in:
commit
4e346e8ca2
159 changed files with 10035 additions and 2880 deletions
|
@ -147,6 +147,7 @@ enum ParserState {
|
|||
PS_FIRST,
|
||||
PS_ARGUMENT,
|
||||
PS_OPTION,
|
||||
PS_QUOTE,
|
||||
};
|
||||
|
||||
#define isSpace(c)(c == ' ' || c == '\t')
|
||||
|
@ -195,6 +196,10 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
|
|||
case PS_ARGUMENT:
|
||||
if (state == PS_FIRST)
|
||||
state = PS_ARGUMENT;
|
||||
if (str[i] == '"') {
|
||||
state = PS_QUOTE;
|
||||
break;
|
||||
}
|
||||
if (isSpace(str[i])) {
|
||||
spaceptr = bufptr;
|
||||
state = PS_FIRST;
|
||||
|
@ -215,6 +220,16 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab
|
|||
*bufptr = str[i];
|
||||
bufptr++;
|
||||
break;
|
||||
case PS_QUOTE:
|
||||
if (str[i] == '"') {
|
||||
*bufptr++ = 0x00;
|
||||
state = PS_FIRST;
|
||||
} else {
|
||||
if (isSpace(str[i]) == false) {
|
||||
*bufptr++ = str[i];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (bufptr > bufptrend) {
|
||||
PrintAndLogEx(ERR, "ERROR: Line too long\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue