Skip to content

Commit

Permalink
better argument prefix validation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 25, 2020
1 parent 3c49eee commit ecda75d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -83,7 +83,6 @@ public void fillStr(String string) {
raw_value = string;
int first_colon = string.indexOf(':');
int first_not_prefix = prefixCharsAllowed.indexOfFirstNonMatch(string);

if ((first_not_prefix > -1 && first_not_prefix < first_colon) || first_colon == -1) {
value = string;
if (object == null) {
Expand Down
Expand Up @@ -533,7 +533,7 @@ public List<String> filter(Enum[] values) {
}

public <T extends ObjectTag> List<T> filter(Class<T> dClass, ScriptEntry entry) {
return filter(dClass, (entry == null ? CoreUtilities.basicContext : entry.entryData.getTagContext()), true);
return filter(dClass, entry == null ? CoreUtilities.basicContext : entry.entryData.getTagContext(), true);
}

public <T extends ObjectTag> List<T> filter(Class<T> dClass, Debuggable debugger, boolean showFailure) {
Expand Down
Expand Up @@ -307,11 +307,12 @@ else if (command.charAt(0) == '~') {
}
InternalArgument argVal = new InternalArgument();
internal.args_ref.set(i, argVal);
int colon = TagManager.findColonNotTagNorSpace(arg);
if (colon > 0) {
int first_colon = arg.indexOf(':');
int first_not_prefix = Argument.prefixCharsAllowed.indexOfFirstNonMatch(arg);
if (first_colon > 0 && first_not_prefix >= first_colon) {
argVal.prefix = new InternalArgument();
crunchInto(argVal.prefix, arg.substring(0, colon), refContext);
arg = arg.substring(colon + 1);
crunchInto(argVal.prefix, arg.substring(0, first_colon), refContext);
arg = arg.substring(first_colon + 1);
if (!argVal.prefix.aHArg.needsFill) {
internal.argPrefixMap.put(argVal.prefix.aHArg.lower_value, i);
}
Expand Down

0 comments on commit ecda75d

Please sign in to comment.