diff options
| -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 { | 
