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 /src | |
| parent | 72c5691efc63852254bf0af8ca81d3ba859b1c1a (diff) | |
| download | podcast-31088213c082c5c507cb74a970b022944240ef5a.tar.bz2 | |
Update filename escapement to be OS sepecific
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 2 | ||||
| -rw-r--r-- | src/structs.rs | 9 |
2 files changed, 9 insertions, 2 deletions
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 { |
