diff options
| author | Amos Wenger | 2013-08-15 21:50:13 +0200 |
|---|---|---|
| committer | Jack Nagel | 2013-08-19 13:35:44 -0500 |
| commit | 52ace99f14a9390f5bf71370d616f2ed6b98c034 (patch) | |
| tree | 48580569d443ddbebf2a06f99efb3a0ebe94208a /Library/Homebrew/utils.rb | |
| parent | 809a52a6a3e8b0899aa2697f767b8dcc22210bd8 (diff) | |
| download | brew-52ace99f14a9390f5bf71370d616f2ed6b98c034.tar.bz2 | |
Use File::PATH_SEPARATOR globally instead of ':'
On Unix, the path separator is ':', whereas on Windows,
it is ';'. This is the first of a series of patch to bring
macbrew's and winbrew's codebases closer together.
The main places the magic constant ':' was being used were:
- the $PATH environment variable
- CMAKE-related environment variables
- pkg-config related environment variables
Closes Homebrew/homebrew#21921.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/utils.rb')
| -rw-r--r-- | Library/Homebrew/utils.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 2224e4ed0..b10764803 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -167,7 +167,7 @@ def puts_columns items, star_items=[] end def which cmd, path=ENV['PATH'] - dir = path.split(':').find {|p| File.executable? File.join(p, cmd)} + dir = path.split(File::PATH_SEPARATOR).find {|p| File.executable? File.join(p, cmd)} Pathname.new(File.join(dir, cmd)) unless dir.nil? end |
