[jboss-jira] [JBoss JIRA] (WFLY-7321) wrong parse of double quote in `\\"`
Hisanobu Okuda (JIRA)
issues at jboss.org
Mon Oct 17 06:37:00 EDT 2016
[ https://issues.jboss.org/browse/WFLY-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13307749#comment-13307749 ]
Hisanobu Okuda commented on WFLY-7321:
--------------------------------------
In org.jboss.aesh.parser.Parser.doesStringContainOpenQuote(), if a back-slash is ahead of the second double quote, it wrongly returns true even if a back-slash is escaped with another back-slash.
{code}
521 public static boolean doesStringContainOpenQuote(String text) {
522 boolean doubleQuote = false;
523 boolean singleQuote = false;
524 for (int i = 0; i < text.length(); i++) {
525 if (text.charAt(i) == SINGLE_QUOTE) {
526 if (!doubleQuote &&
527 (i == 0 || (i > 0 && !(text.charAt(i - 1) == BACK_SLASH))))
528 singleQuote = !singleQuote;
529 }
530 else if (text.charAt(i) == DOUBLE_QUOTE) {
531 if (!singleQuote &&
532 (i == 0 || (i > 0 && !(text.charAt(i - 1) == BACK_SLASH))))
533 doubleQuote = !doubleQuote;
534 }
535 }
536 return doubleQuote || singleQuote;
537 }
{code}
> wrong parse of double quote in `\\"`
> -------------------------------------
>
> Key: WFLY-7321
> URL: https://issues.jboss.org/browse/WFLY-7321
> Project: WildFly
> Issue Type: Bug
> Components: CLI
> Environment: JBoss EAP 7.0.0
> Reporter: Hisanobu Okuda
> Assignee: Jason Greene
>
> jboss-cli does not parse command line if command line contains {code}\\"{code}
> When a command is
> {code}/system-property=foo4:add(value="vvv\\"){code}
> it shows the sub-prompt '> ' like:
> {code}
> [standalone at localhost:9990 /] /system-property=foo4:add(value="vvv\\")
> >
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list