зеркало из 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>
|
Sun Mar 6 06:34:31 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
* ext/openssl/ossl_ssl.c (ossl_start_ssl): should wait for that
|
* 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.group {
|
||||||
q.text "uid="; q.pp self.uid
|
q.text "uid="; q.pp self.uid
|
||||||
begin
|
begin
|
||||||
name = Etc.getpwuid(self.uid).name
|
pw = Etc.getpwuid(self.uid)
|
||||||
q.breakable; q.text "(#{name})"
|
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
end
|
end
|
||||||
|
if pw
|
||||||
|
q.breakable; q.text "(#{pw.name})"
|
||||||
|
end
|
||||||
}
|
}
|
||||||
q.comma_breakable
|
q.comma_breakable
|
||||||
q.group {
|
q.group {
|
||||||
q.text "gid="; q.pp self.gid
|
q.text "gid="; q.pp self.gid
|
||||||
begin
|
begin
|
||||||
name = Etc.getgrgid(self.gid).name
|
gr = Etc.getgrgid(self.gid)
|
||||||
q.breakable; q.text "(#{name})"
|
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
end
|
end
|
||||||
|
if gr
|
||||||
|
q.breakable; q.text "(#{gr.name})"
|
||||||
|
end
|
||||||
}
|
}
|
||||||
q.comma_breakable
|
q.comma_breakable
|
||||||
q.group {
|
q.group {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче