Skip to content

Commit

Permalink
Merge pull request #3518 from rolandwalker/casecmp_fixes
Browse files Browse the repository at this point in the history
fix some erroneous uses of `casecmp`
  • Loading branch information
rolandwalker committed Mar 12, 2014
2 parents 0d18021 + ba8d9ba commit f531839
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cask/caveats.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def path_environment_variable(path)

def files_in_usr_local
localpath = '/usr/local'
if localpath.casecmp(HOMEBREW_PREFIX)
if HOMEBREW_PREFIX.downcase.index(localpath) == 0
puts <<-EOS.undent
Cask #{@cask} installs files under "#{localpath}". The presence of such
files can cause warnings when running "brew doctor", which is considered
Expand Down
2 changes: 1 addition & 1 deletion lib/cask/container/criteria.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def lsar

def extension(test)
%r{\.([^\.]+)$}.match(path) do |ext|
ext.captures.first.casecmp(test)
ext.captures.first.casecmp(test) == 0
end
end

Expand Down

0 comments on commit f531839

Please sign in to comment.