Cope with leading whitespace in shebang.
This commit is contained in:
parent
d6f35c9657
commit
7456ee7d12
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ def shebang_binary(p):
|
||||||
firstline = f.readline()
|
firstline = f.readline()
|
||||||
if not firstline.startswith(b"#!"):
|
if not firstline.startswith(b"#!"):
|
||||||
return None
|
return None
|
||||||
args = firstline[2:].split(b" ")
|
args = firstline[2:].strip().split(b" ")
|
||||||
if args[0] in (b"/usr/bin/env", b"env"):
|
if args[0] in (b"/usr/bin/env", b"env"):
|
||||||
return os.path.basename(args[1].decode()).strip()
|
return os.path.basename(args[1].decode()).strip()
|
||||||
return os.path.basename(args[0].decode()).strip()
|
return os.path.basename(args[0].decode()).strip()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue