Merge pull request #32 from ids1024/process

Strip whitspaces after #!
This commit is contained in:
Jeremy Soller
2017-07-13 07:11:39 -06:00
committed by GitHub

View File

@@ -584,6 +584,9 @@ pub fn exec(path: &[u8], arg_ptrs: &[[usize; 2]]) -> Result<usize> {
if data.starts_with(b"#!") {
if let Some(line) = data[2..].split(|&b| b == b'\n').next() {
// Strip whitespace
let line = &line[line.iter().position(|&b| b != b' ')
.unwrap_or(0)..];
if ! args.is_empty() {
args.remove(0);
}