From 2e961dc9dee63f641f7f162fd7a2845c5fd092fe Mon Sep 17 00:00:00 2001
From: Martin Afanasjew <martin@afanasjew.de>
Date: Wed, 11 May 2016 06:04:35 +0200
Subject: [PATCH] formula_installer: fix option-with-value handling

When passing formula options with value, e.g. `--with-qt=5`, to the
child process responsible for building a formula, `ARGV.value` would be
invoked with `nil`. Handle this more elegantly (no change in behavior).

For consistency, use a regular expression adapted from `Options.create`
instead of the somewhat bogus one used before.
---
 Library/Homebrew/formula_installer.rb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb
index 00678935d9..c9d1f42d65 100644
--- a/Library/Homebrew/formula_installer.rb
+++ b/Library/Homebrew/formula_installer.rb
@@ -538,9 +538,9 @@ class FormulaInstaller
     end
 
     formula.options.each do |opt|
-      name  = opt.name[/\A(.+)=\z$/, 1]
-      value = ARGV.value(name)
-      args << "--#{name}=#{value}" if name && value
+      name = opt.name[/^([^=])+=$/, 1]
+      value = ARGV.value(name) if name
+      args << "--#{name}=#{value}" if value
     end
 
     args
-- 
GitLab