version 1.134, 2019/08/05 11:50:33 |
version 1.135, 2019/09/03 08:30:47 |
|
|
} |
} |
} |
} |
|
|
|
/* |
|
* Advanced *cpp past the end of key options, defined as the first unquoted |
|
* whitespace character. Returns 0 on success or -1 on failure (e.g. |
|
* unterminated quotes). |
|
*/ |
|
int |
|
sshkey_advance_past_options(char **cpp) |
|
{ |
|
char *cp = *cpp; |
|
int quoted = 0; |
|
|
|
for (; *cp && (quoted || (*cp != ' ' && *cp != '\t')); cp++) { |
|
if (*cp == '\\' && cp[1] == '"') |
|
cp++; /* Skip both */ |
|
else if (*cp == '"') |
|
quoted = !quoted; |
|
} |
|
*cpp = cp; |
|
/* return failure for unterminated quotes */ |
|
return (*cp == '\0' && quoted) ? -1 : 0; |
|
} |
|
|