aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Jaremko2018-05-16 23:42:33 -0400
committerNathan Jaremko2018-05-16 23:42:33 -0400
commit31088213c082c5c507cb74a970b022944240ef5a (patch)
tree2e75b9ccde9d3d343b125a3b86b3a8d655fdb001
parent72c5691efc63852254bf0af8ca81d3ba859b1c1a (diff)
downloadpodcast-31088213c082c5c507cb74a970b022944240ef5a.tar.bz2
Update filename escapement to be OS sepecific
-rw-r--r--CHANGELOG3
-rw-r--r--Cargo.toml2
-rw-r--r--src/main.rs2
-rw-r--r--src/structs.rs9
4 files changed, 13 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 708cc65..56218d4 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
diff --git a/Cargo.toml b/Cargo.toml
index 55196b6..ca03821 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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 {