MicrosoftGame.config: attribute values with their character references replaced #52

Manually merged
github merged 1 commit from gh-pr/52/head into gh-pr/52/base 2026-11-26 04:06:40 +00:00
Owner

@⁠gefydev on GitHub · 2026-11-22 22:35 UTC · original
gefydev:xml-attr-entities → main · +50 −1 · 1 files · 1 commits · merged 2026-11-22 22:40 UTC

xml_attrs (launcher.rs) returns attribute values as they are written in MicrosoftGame.config. A & in an attribute has to be written &, so since 9a15c53 a game called "Ratchet & Clank" gets XCL – Ratchet & Clank as its window title. The same reader gives the Executable Name values, and an escaped character there names a file that doesn't exist.

Values now go through a small xml_unescape: the five named references (& < > " ') and numeric ones (', '). Anything that isn't a valid reference (a bare &,  , &#xZZ;) stays as written.

Validation

  • New test attribute_values_have_their_character_references_replaced, and a & case in display_name_is_the_shell_name_unless_it_is_a_resource. Both fail on main and pass with the change.
  • cargo test -p xcl --lib: 340 passed, 0 failed, on Windows GNU under Wine.
**@⁠gefydev** on GitHub · 2026-11-22 22:35 UTC · [original](https://github.com/xcl-dev/xcl/pull/52) `gefydev:xml-attr-entities` → `main` · +50 −1 · 1 files · 1 commits · merged 2026-11-22 22:40 UTC `xml_attrs` (`launcher.rs`) returns attribute values as they are written in `MicrosoftGame.config`. A `&` in an attribute has to be written `&`, so since 9a15c53 a game called "Ratchet & Clank" gets `XCL – Ratchet & Clank` as its window title. The same reader gives the `Executable Name` values, and an escaped character there names a file that doesn't exist. Values now go through a small `xml_unescape`: the five named references (`&` `<` `>` `"` `'`) and numeric ones (`'`, `'`). Anything that isn't a valid reference (a bare `&`, ` `, `&#xZZ;`) stays as written. ## Validation - New test `attribute_values_have_their_character_references_replaced`, and a `&` case in `display_name_is_the_shell_name_unless_it_is_a_resource`. Both fail on `main` and pass with the change. - `cargo test -p xcl --lib`: 340 passed, 0 failed, on Windows GNU under Wine.
xml_attrs returned values as written, so a display name such as
"Ratchet & Clank" showed in the XCL window's title with the &,
and an Executable Name with an escaped character named a file that does
not exist. The five named references and numeric ones are now replaced;
anything else stays as written.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:06:38 +00:00
github manually merged commit a081a6575b into gh-pr/52/base 2026-11-26 04:06:40 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-22 22:41 UTC · original

Thanks, merged, and good catch on my 9a15c53!

The decoder looks right to me:

  • only a well-formed reference is replaced, and a bare & or   stays as written;
  • ' with an upper-case X stays too, which matches XML, where hex references take a lower-case x.

The values it touches are the Executable names, the Identity name and the display name. Of those, only the display name and the exe names can contain a &; package identities can't.

All tests pass with the MSVC toolchain on Windows: 343 lib tests with your new one, plus the e2e test title. My four titles' configs have no & at all, so nothing changes for them.

**@⁠ivall** on GitHub · 2026-11-22 22:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/52#issuecomment-7087001337) Thanks, merged, and good catch on my 9a15c53! The decoder looks right to me: - only a well-formed reference is replaced, and a bare `&` or ` ` stays as written; - `'` with an upper-case X stays too, which matches XML, where hex references take a lower-case `x`. The values it touches are the `Executable` names, the `Identity` name and the display name. Of those, only the display name and the exe names can contain a `&`; package identities can't. All tests pass with the MSVC toolchain on Windows: 343 lib tests with your new one, plus the e2e test title. My four titles' configs have no `&` at all, so nothing changes for them.
This discussion has been locked. Commenting is limited to contributors.
No description provided.