mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io/io.rb (IO.read): should not allow path starting "|"
It was made obsolete long time ago.
This commit is contained in:
@@ -64,12 +64,8 @@ class IO
|
||||
fd = -1
|
||||
io = nil
|
||||
begin
|
||||
if path[0] == "|"
|
||||
io = IO.popen(path[1..-1], mode)
|
||||
else
|
||||
fd = IO.sysopen(path, mode)
|
||||
io = IO.open(fd, mode)
|
||||
end
|
||||
fd = IO.sysopen(path, mode)
|
||||
io = IO.open(fd, mode)
|
||||
io.seek(offset) if offset > 0
|
||||
str = io.read(length)
|
||||
ensure
|
||||
|
||||
Reference in New Issue
Block a user