Skip to content

Commit

Permalink
Untabify
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshi Nakamura committed Mar 2, 2012
1 parent a30b68d commit 716166f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions lib/ruby/1.8/tmpdir.rb
Expand Up @@ -47,15 +47,15 @@ def Dir::tmpdir
# Opening directory is not allowed in Java.
dirs = [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], ENV['USERPROFILE'], @@systmpdir, '/tmp', tmp]
for dir in dirs
if dir and File.directory?(dir) and File.writable?(dir) and (File.stat(dir).mode & 0002) == 0
if dir and File.directory?(dir) and File.writable?(dir) and (File.stat(dir).mode & 0002) == 0
return File.expand_path(dir)
end
end
end
for dir in dirs
if dir and File.directory?(dir) and File.writable?(dir)
tmp = dir
break
end
if dir and File.directory?(dir) and File.writable?(dir)
tmp = dir
break
end
end
File.expand_path(tmp)
end
Expand Down
10 changes: 5 additions & 5 deletions lib/ruby/1.9/tmpdir.rb
Expand Up @@ -28,15 +28,15 @@ def Dir::tmpdir
# Opening directory is not allowed in Java.
dirs = [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', tmp]
for dir in dirs
if dir and stat = File.stat(dir) and stat.directory? and stat.writable? and !stat.world_writable?
if dir and stat = File.stat(dir) and stat.directory? and stat.writable? and !stat.world_writable?
return File.expand_path(dir)
end
end
for dir in dirs
if dir and stat = File.stat(dir) and stat.directory? and stat.writable?
tmp = dir
break
end rescue nil
if dir and stat = File.stat(dir) and stat.directory? and stat.writable?
tmp = dir
break
end rescue nil
end
File.expand_path(tmp)
end
Expand Down

0 comments on commit 716166f

Please sign in to comment.