mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
Merge pull request #11339 from NixOS/backport-11332-to-2.21-maintenance
[Backport 2.21-maintenance] [Backport 2.22-maintenance] fix: check to see if there are any lines before
This commit is contained in:
commit
2046691498
@ -134,7 +134,7 @@ static void main_nix_build(int argc, char * * argv)
|
|||||||
script = argv[1];
|
script = argv[1];
|
||||||
try {
|
try {
|
||||||
auto lines = tokenizeString<Strings>(readFile(script), "\n");
|
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();
|
lines.pop_front();
|
||||||
inShebang = true;
|
inShebang = true;
|
||||||
for (int i = 2; i < argc; ++i)
|
for (int i = 2; i < argc; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user