handle # comment in quotes

This commit is contained in:
Lowly Worm 2018-01-05 19:16:54 -08:00
parent d96b46c7a4
commit 29507bc2b9
1 changed files with 9 additions and 0 deletions

View File

@ -1556,6 +1556,15 @@ static int r_core_cmd_subst(RCore *core, char *cmd) {
goto beach;
}
cmt = *icmd ? strchr (icmd + 1, '#'): NULL;
if (cmt) {
// must honor "
char *ch;
ut32 cnt = 0;
for (ch = icmd + 1; ch < cmt; ++ch) {
if (*ch == '"') ++cnt;
}
if (cnt == 0 || (cnt % 2)) cmt = NULL;
}
if (cmt && (cmt[1] == ' ' || cmt[1] == '\t')) {
*cmt = 0;
}