-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
If there is an even number of quotes in the arguments of a command, the outer pair is always removed. The string a "string with "quotes"" becomes a string with "quotes", for example. This is not always desirable (see PGMDev/PGM#259).
This appears to be the cause of the problem:
intake/core/src/main/java/app/ashcon/intake/argument/CommandContext.java
Lines 108 to 140 in 5967b51
| case '"': | |
| final StringBuilder build = new StringBuilder(); | |
| final char quotedChar = arg.charAt(0); | |
| int endIndex; | |
| for (endIndex = i; endIndex < args.length; ++endIndex) { | |
| final String arg2 = args[endIndex]; | |
| if (arg2.charAt(arg2.length() - 1) == quotedChar && arg2.length() > 1) { | |
| if (endIndex != i) { | |
| build.append(' '); | |
| } | |
| build.append(arg2.substring(endIndex == i ? 1 : 0, arg2.length() - 1)); | |
| break; | |
| } | |
| else if (endIndex == i) { | |
| build.append(arg2.substring(1)); | |
| } | |
| else { | |
| build.append(' ').append(arg2); | |
| } | |
| } | |
| if (endIndex < args.length) { | |
| arg = build.toString(); | |
| i = endIndex; | |
| } | |
| // In case there is an empty quoted string | |
| if (arg.isEmpty()) { | |
| continue; | |
| } | |
| // else raise exception about hanging quotes? | |
| } |
Metadata
Metadata
Assignees
Labels
No labels