diff options
| author | Nathan Jaremko | 2018-05-16 23:42:33 -0400 |
|---|---|---|
| committer | Nathan Jaremko | 2018-05-16 23:42:33 -0400 |
| commit | 31088213c082c5c507cb74a970b022944240ef5a (patch) | |
| tree | 2e75b9ccde9d3d343b125a3b86b3a8d655fdb001 | |
| parent | 72c5691efc63852254bf0af8ca81d3ba859b1c1a (diff) | |
| download | podcast-31088213c082c5c507cb74a970b022944240ef5a.tar.bz2 | |
Update filename escapement to be OS sepecific
| -rw-r--r-- | CHANGELOG | 3 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/main.rs | 2 | ||||
| -rw-r--r-- | src/structs.rs | 9 |
4 files changed, 13 insertions, 3 deletions
@@ -1,3 +1,6 @@ +0.5.7 +- Updates filename escaping to generally only affect Windows (because Microsoft filesystems can't handle a bunch of characters) + 0.5.6 - Escape filenames to prevent issues on some filesystems @@ -1,6 +1,6 @@ [package] name = "podcast" -version = "0.5.6" +version = "0.5.7" authors = ["Nathan Jaremko <njaremko@gmail.com>"] description = "A command line podcast manager" license = "GPL-3.0" diff --git a/src/main.rs b/src/main.rs index 96572cc..b55bff9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,7 +31,7 @@ use utils::*; use clap::{App, Arg, SubCommand}; -const VERSION: &str = "0.5.6"; +const VERSION: &str = "0.5.7"; fn main() -> Result<()> { create_directories().chain_err(|| "unable to create directories")?; diff --git a/src/structs.rs b/src/structs.rs index 97e6718..e585677 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -14,8 +14,15 @@ use rss::{Channel, Item}; use serde_json; use yaml_rust::YamlLoader; +#[cfg(target_os = "macos")] +static ESCAPE_REGEX: &str = r"/"; +#[cfg(target_os = "linux")] +static ESCAPE_REGEX: &str = r"/"; +#[cfg(target_os = "windows")] +static ESCAPE_REGEX: &str = r#"[\\/:*?"<>|]"#; + lazy_static! { - static ref FILENAME_ESCAPE: Regex = Regex::new(r#"[\\/:*?"<>|]"#).unwrap(); + static ref FILENAME_ESCAPE: Regex = Regex::new(ESCAPE_REGEX).unwrap(); } pub struct Config { |
