mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02:00
Merge pull request #11329 from tomberek/tomberek.shell_segfault
fix: check to see if there are any lines before
This commit is contained in:
commit
8e4149af6f
1 changed files with 1 additions and 1 deletions
|
@ -163,7 +163,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 a new issue