Commit a9247f72 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

condition updated to preven printf from sprintf redefinition

parent 3705bfb0
......@@ -51,11 +51,13 @@ module Kernel
##
# Invoke method +sprintf+ and pass +*args+ to it.
# Pass return value to +print+ of STDOUT.
def printf(*args)
if Kernel.respond_to?(:sprintf)
if Kernel.respond_to?(:sprintf) and Kernel.respond_to?(:__printstr__)
def printf(*args)
__printstr__(sprintf(*args))
else
raise NotImplementedError.new('sprintf not available')
end
else
def printf(*args)
raise NotImplementedError.new('printf not available')
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment