From d907d5a5a3adec15d31be8ad80538e905f6d43cd Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Sat, 17 Aug 2024 19:01:57 -0400 Subject: [PATCH] #49: Filter out unprintable characters --- data/manifest.yaml | 33 ++------------------------------- data/missing.md | 1 + src/path.rs | 9 ++++++++- src/registry.rs | 4 +++- 4 files changed, 14 insertions(+), 33 deletions(-) diff --git a/data/manifest.yaml b/data/manifest.yaml index 7bfae358..95bbde82 100644 --- a/data/manifest.yaml +++ b/data/manifest.yaml @@ -72592,11 +72592,6 @@ Bicyclism EP: - when: - os: windows store: steam - registry: - "HKEY_CURRENT_USER/Software/Tale of Tales/BientoÌ‚t l'été": - tags: - - config - - save steam: id: 229600 Bierzerkers: @@ -180864,11 +180859,6 @@ Divine Divinity: - save when: - os: windows - "/Library/Application Support/GOG.com/Divine Divinity⁩/savegames⁩": - tags: - - save - when: - - os: mac gog: id: 1207658805 id: @@ -182144,13 +182134,6 @@ Dog-O: steam: true steam: id: 1004520 -DogDay: - files: - "‪C:/Windows/DOGDAY.INI": - tags: - - config - when: - - os: windows DogFighter: cloud: steam: true @@ -271277,11 +271260,6 @@ Go Outside Simulator: id: 413760 "Go West: A Lucky Luke Adventure": files: - "/lang.ini\n/launcher.ini\n/user.ini": - tags: - - config - when: - - os: windows "/savegames": tags: - save @@ -622545,11 +622523,9 @@ Supreme Ruler The Great War: cloud: steam: true files: - Library⁩ ▸ ⁨Application Support⁩ ▸ ⁨Steam⁩ ▸ ⁨steamapps⁩ ▸ ⁨common⁩ ▸ ⁨Supreme Ruler Great War⁩ ▸ ⁨SupremeRulerGreatWar⁩ ▸ ⁨Contents⁩ ▸ ⁨Resources⁩ ▸ ⁨drive_c⁩ ▸ ⁨users⁩ ▸ ⁨Wineskin⁩ ▸ ⁨My Documents⁩ ▸ ⁨My Games⁩ ▸: - tags: - - save + "/My Games/Supreme Ruler Great War/SteamCloud/*.sav": when: - - os: mac + - store: steam id: lutris: supreme-ruler-the-great-war installDir: @@ -683620,11 +683596,6 @@ Thief Simulator: - save when: - os: windows - "/Library/Containers/com.noblemuffins.thiefsimulator/Data/Library/Application Support/com.noblemuffins.thiefsimulator/\nOR\n~/Library/Application Support/unity.DefaultCompany.UFPS": - tags: - - save - when: - - os: mac gog: id: 2020235723 installDir: diff --git a/data/missing.md b/data/missing.md index 6a3fc704..a816dc97 100644 --- a/data/missing.md +++ b/data/missing.md @@ -7134,6 +7134,7 @@ * [Dog's Quest](https://www.pcgamingwiki.com/wiki/?curid=98728) * [Dog-O](https://www.pcgamingwiki.com/wiki/?curid=151525) * [Dogcoin](https://www.pcgamingwiki.com/wiki/?curid=68420) +* [DogDay](https://www.pcgamingwiki.com/wiki/?curid=192226) * [Dogfight Elite](https://www.pcgamingwiki.com/wiki/?curid=33852) * [Dogfight: 80 Years of Aerial Warfare](https://www.pcgamingwiki.com/wiki/?curid=177418) * [DogFighter](https://www.pcgamingwiki.com/wiki/?curid=51094) diff --git a/src/path.rs b/src/path.rs index b3be2039..daabe208 100644 --- a/src/path.rs +++ b/src/path.rs @@ -135,5 +135,12 @@ fn too_broad(path: &str) -> bool { } pub fn usable(path: &str) -> bool { - !path.is_empty() && !path.contains("{{") && !path.starts_with("./") && !path.starts_with("../") && !too_broad(path) + static UNPRINTABLE: Lazy = Lazy::new(|| Regex::new(r"(\p{Cc}|\p{Cf})").unwrap()); + + !path.is_empty() + && !path.contains("{{") + && !path.starts_with("./") + && !path.starts_with("../") + && !too_broad(path) + && !UNPRINTABLE.is_match(path) } diff --git a/src/registry.rs b/src/registry.rs index ed209863..ab890bf6 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -50,5 +50,7 @@ fn too_broad(path: &str) -> bool { } pub fn usable(path: &str) -> bool { - !path.is_empty() && !path.contains("{{") && !too_broad(path) + static UNPRINTABLE: Lazy = Lazy::new(|| Regex::new(r"(\p{Cc}|\p{Cf})").unwrap()); + + !path.is_empty() && !path.contains("{{") && !too_broad(path) && !UNPRINTABLE.is_match(path) }