Skip to content

Commit

Permalink
fix: quote file names that contain spaces when printing them to stdout (
Browse files Browse the repository at this point in the history
  • Loading branch information
fredmorcos authored Nov 20, 2024
1 parent d3564f2 commit 21cdaae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/television-channels/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ impl Entry {

pub fn stdout_repr(&self) -> String {
let mut repr = self.name.clone();
if repr.contains(|c| char::is_ascii_whitespace(&c)) {
repr.insert(0, '\'');
repr.push('\'');
}
if let Some(line_number) = self.line_number {
repr.push_str(&format!(":{line_number}"));
}
Expand Down

0 comments on commit 21cdaae

Please sign in to comment.