summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 79a95c1462..a448459d46 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1709,7 +1709,8 @@ XXX
f |= Regexp::IGNORECASE if /i/ =~ o
f |= Regexp::MULTILINE if /m/ =~ o
f |= Regexp::EXTENDED if /x/ =~ o
- k = o.delete("^imx")
+ k = o.delete("imx")
+ k = nil if k.empty?
end
Regexp.new(s || all, f, k)
end