diff --git a/crates/rwalk/src/cli/parse.rs b/crates/rwalk/src/cli/parse.rs index f5e4206..d081b48 100644 --- a/crates/rwalk/src/cli/parse.rs +++ b/crates/rwalk/src/cli/parse.rs @@ -103,7 +103,9 @@ pub fn parse_key_or_keyval(s: &str) -> Result<(String, Option)> { if parts.len() > 2 { return Err(syntax_error!((0, s.len()), s, "Expected at most one ':'")); } - Ok((parts[0].to_lowercase(), parts.get(1).map(|s| s.to_string()))) + let key = parts[0].to_string(); // ← no lowercase here + let value = parts.get(1).map(|s| s.to_string()); + Ok((key, value)) } pub fn parse_wordlist(s: &str) -> Result<(String, String)> { diff --git a/crates/rwalk/src/wordlist/processor.rs b/crates/rwalk/src/wordlist/processor.rs index d731a21..c01a41d 100644 --- a/crates/rwalk/src/wordlist/processor.rs +++ b/crates/rwalk/src/wordlist/processor.rs @@ -114,14 +114,15 @@ impl<'a> WordlistProcessor<'a> { include_comments: bool, ) -> Result<()> { debug!("Processing wordlist: {}", path); - let path = PathBuf::from(&*path) + + let canonical_path = PathBuf::from(&*path) .canonicalize() .map_err(|e| crate::error!("Failed to open wordlist file {}: {}", path.bold(), e))?; - - let file = File::open(&*path).await?; + + let file = File::open(&canonical_path).await?; let reader = BufReader::new(file); let mut lines = reader.lines(); - + while let Some(line) = lines.next_line().await? { if !line.trim().is_empty() { let processed_line = if include_comments { @@ -129,20 +130,20 @@ impl<'a> WordlistProcessor<'a> { } else { Self::strip_comments(&line) }; - + if let Some(mut word) = processed_line { transformer.apply(&mut word); let word: CowStr = word.into(); - + if filterer.filter(&(key.clone(), word.clone()))? { shared_words.entry(key.clone()).or_default().insert(word); } } } } - + Ok(()) - } + } fn create_transformer(&self, wordlist_key: &str) -> Result> { let transformers = self