зеркало из https://github.com/github/ruby.git
* lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
may return nil. [ruby-talk:129826] reported by Daniel Berger. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
771a610bfa
Коммит
25d8e7a119
|
@ -1,3 +1,9 @@
|
|||
Sun Mar 6 11:36:37 2005 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
|
||||
may return nil. [ruby-talk:129826]
|
||||
reported by Daniel Berger.
|
||||
|
||||
Sun Mar 6 06:34:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* ext/openssl/ossl_ssl.c (ossl_start_ssl): should wait for that
|
||||
|
|
12
lib/pp.rb
12
lib/pp.rb
|
@ -407,19 +407,23 @@ class File
|
|||
q.group {
|
||||
q.text "uid="; q.pp self.uid
|
||||
begin
|
||||
name = Etc.getpwuid(self.uid).name
|
||||
q.breakable; q.text "(#{name})"
|
||||
pw = Etc.getpwuid(self.uid)
|
||||
rescue ArgumentError
|
||||
end
|
||||
if pw
|
||||
q.breakable; q.text "(#{pw.name})"
|
||||
end
|
||||
}
|
||||
q.comma_breakable
|
||||
q.group {
|
||||
q.text "gid="; q.pp self.gid
|
||||
begin
|
||||
name = Etc.getgrgid(self.gid).name
|
||||
q.breakable; q.text "(#{name})"
|
||||
gr = Etc.getgrgid(self.gid)
|
||||
rescue ArgumentError
|
||||
end
|
||||
if gr
|
||||
q.breakable; q.text "(#{gr.name})"
|
||||
end
|
||||
}
|
||||
q.comma_breakable
|
||||
q.group {
|
||||
|
|
Загрузка…
Ссылка в новой задаче