mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 00:02:25 +00:00
fix: check to see if there are any lines before
(cherry picked from commit59db8fd62b
) (cherry picked from commitaab801db98
)
This commit is contained in:
parent
8c4d8e1e7d
commit
763af319fe
@ -133,7 +133,7 @@ static void main_nix_build(int argc, char * * argv)
|
||||
script = argv[1];
|
||||
try {
|
||||
auto lines = tokenizeString<Strings>(readFile(script), "\n");
|
||||
if (std::regex_search(lines.front(), std::regex("^#!"))) {
|
||||
if (!lines.empty() && std::regex_search(lines.front(), std::regex("^#!"))) {
|
||||
lines.pop_front();
|
||||
inShebang = true;
|
||||
for (int i = 2; i < argc; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user