mirror of
https://github.com/NixOS/nix.git
synced 2024-11-21 22:32:26 +00:00
Merge pull request #11332 from NixOS/backport-11329-to-2.22-maintenance
[Backport 2.22-maintenance] fix: check to see if there are any lines before
This commit is contained in:
commit
12e2efa384
@ -135,7 +135,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