diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 98849bf4..58da9a00 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,12 @@ Doom Struct (C) 2015-2024 by Matt Tropiano et al. (see AUTHORS.txt) +Changed in 2.15.7 +----------------- + +- `Changed` Added more legal characters for `NameUtils.toValidEntryName(String)`. + + Changed in 2.15.6 ----------------- diff --git a/src/main/java/net/mtrop/doom/util/NameUtils.java b/src/main/java/net/mtrop/doom/util/NameUtils.java index f29f6a94..61e4bbaa 100644 --- a/src/main/java/net/mtrop/doom/util/NameUtils.java +++ b/src/main/java/net/mtrop/doom/util/NameUtils.java @@ -59,7 +59,7 @@ public static byte[] toASCIIBytes(String s, int bytelen) * Tests if an input string is a valid entry name. *
* A WadEntry must have a name that is up to 8 characters long, and can only contain - * A-Z (uppercase only), 0-9, and [ ] - _, and +, plus the backslash ("\"). + * A-Z (uppercase only), 0-9, and most symbols plus the backslash ("\"). * @param name the input name to test. * @return true if so, false if not. */ @@ -122,6 +122,30 @@ else if (c == '\\') sb.append(c); else if (c == '^') sb.append(c); + else if (c == '@') + sb.append(c); + else if (c == '#') + sb.append(c); + else if (c == '%') + sb.append(c); + else if (c == '&') + sb.append(c); + else if (c == '=') + sb.append(c); + else if (c == '{') + sb.append(c); + else if (c == '}') + sb.append(c); + else if (c == '(') + sb.append(c); + else if (c == ')') + sb.append(c); + else if (c == '$') + sb.append(c); + else if (c == '*') + sb.append(c); + else if (c == '!') + sb.append(c); else sb.append('-'); }