From b5da98396eee6e2431ffa30d41ad2a75570ab6bb Mon Sep 17 00:00:00 2001 From: Ian Douglas Scott Date: Wed, 12 Jul 2017 23:03:53 -0700 Subject: [PATCH] Strip whitspaces after #! Autotools configure scripts seem to use "#! /bin/sh" --- src/syscall/process.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/syscall/process.rs b/src/syscall/process.rs index f861635..b33d033 100644 --- a/src/syscall/process.rs +++ b/src/syscall/process.rs @@ -584,6 +584,9 @@ pub fn exec(path: &[u8], arg_ptrs: &[[usize; 2]]) -> Result { 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); }