mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-04 18:42:21 +00:00
fix(env): filter all ASCII control characters from leading args
The check for unprintable leading arguments added by firmware used c < 0x1f, which missed 0x1f itself. Use is_ascii_control() instead.
This commit is contained in:
1 parent
f7e7a9122b
commit
5c2724fd22
1 file changed
+1
-1
@@ -52,7 +52,7 @@ pub fn args() -> Result<Vec<String>> {
|
||||
.next()
|
||||
// Filter out unprintable characters and backticks.
|
||||
// Both of which have been observed in the wild.
|
||||
.map(|c| c < 0x1f as char || c == '`')
|
||||
.map(|c| c.is_ascii_control() || c == '`')
|
||||
.unwrap_or(false)
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in new issue
Block a user