fix(paths): accept literal tilde-digit filenames

Catalog generation and peer install/download validation rejected any path component containing a tilde followed by digits, even when the component was a valid long filename such as Bosons TD Gold~1.w3m. Remove the heuristic from all three validators and retain the existing device-name and portable-alias checks. Add a regression test for the literal filename so catalog publication and later path validation agree.

Test Plan:
- just clippy (passed)
- just test (passed)
- git diff --check (passed)
This commit is contained in:
ddidderr committed 2026-08-20 08:38:36 +02:00
1 parent bb5547f1b3
commit 76eec55103
3 files changed
+5 -40

No files matched your search

@@ -370,9 +370,6 @@ fn validate_component(component: &str) -> eyre::Result<()> {
if is_windows_device_name(device_stem) {
eyre::bail!("download path uses a Windows device name: {component}");
}
if looks_like_dos_short_name(component) {
eyre::bail!("download path resembles a Windows short-name alias: {component}");
}
Ok(())
}
@@ -393,16 +390,6 @@ fn is_windows_device_name(stem: &str) -> bool {
})
}
fn looks_like_dos_short_name(component: &str) -> bool {
let stem = component.split('.').next().unwrap_or_default();
stem.rsplit_once('~').is_some_and(|(prefix, suffix)| {
!prefix.is_empty()
&& !suffix.is_empty()
&& suffix.len() <= 6
&& suffix.bytes().all(|byte| byte.is_ascii_digit())
})
}
fn validate_existing_destination(
game_root: &Path,
components: &[&str],