# File referrercop, line 385
def self.load_blacklist(filename = nil)
  # Load blacklist.
  if filename == nil
    CONFIG_PATHS.each do |path|
      testname = File.join(path, 'blacklist.refcop')

      if File.exist?(testname)
        @options.blacklist = testname
        break
      end
    end

    if @options.blacklist == nil
      abort('Error: Blacklist file not found.')
    end
  end

  $stderr.puts "Using blacklist #{@options.blacklist}" if $VERBOSE

  # Compile regular expressions.
  blacklist = Array.new

  IO.foreach(@options.blacklist) do |line|
    # Strip comments.
    line.sub!(/#.*/, '')
    line.strip!

    # Skip the line if it's empty.
    next if line.empty?

    # Compile the expression.
    blacklist << Regexp.new(@options.prefix + line + @options.suffix,
      Regexp::IGNORECASE)
  end

  $stderr.puts "Compiled #{blacklist.length} blacklist patterns" if $VERBOSE

  return blacklist
end