Skip to content
Myr

formatting

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by curious-rabbit · committed by curious-rabbit · parent 63a7d85 · Browse files · 2 files+19 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+19 added−4 removed

  • other:+19 added−4 removed

2 files+19 added−4 removed

modified:src/exec/mod.rs+3 added-1 removed
241 unmodified lines
242 bail!("No executable provided for --exec or --exec-batch");243 }244245 if args[0].has_tokens() {246 bail!("First argument of --exec/--exec-batch must be a fixed executable, not a placeholder");246 bail!(247 "First argument of --exec/--exec-batch must be a fixed executable, not a placeholder"248 );249 }250251 // If a placeholder token was not supplied, append one at the end of the command.252 if !has_placeholder {
231 unmodified lines
modified:src/sanitize.rs+16 added-3 removed
30 unmodified lines
31 use super::*;3233 #[test]34 fn preserves_safe_content() {35 for s in ["hello.txt", "résumé.pdf", "文档.txt", "🦀.rs", "a\tb", "a\u{FFFD}b"] {36 assert!(matches!(sanitize_for_terminal(s), Cow::Borrowed(_)), "{s:?}");35 for s in [36 "hello.txt",37 "résumé.pdf",38 "文档.txt",39 "🦀.rs",40 "a\tb",41 "a\u{FFFD}b",42 ] {43 assert!(44 matches!(sanitize_for_terminal(s), Cow::Borrowed(_)),45 "{s:?}"46 );47 assert_eq!(sanitize_for_terminal(s), s);48 }49 }50
41 unmodified lines
92 #[test]93 fn strips_c1_csi_and_osc_initiators() {94 // U+009B is CSI, U+009D is OSC; dangerous on 8-bit-control terminals.95 assert_eq!(sanitize_for_terminal("\u{9b}31m"), "\\x9B31m");86 assert_eq!(sanitize_for_terminal("\u{9d}0;pwned\u{9c}"), "\\x9D0;pwned\\x9C");96 assert_eq!(97 sanitize_for_terminal("\u{9d}0;pwned\u{9c}"),98 "\\x9D0;pwned\\x9C"99 );100 }101}