mruby-io/io.rb (IO.read): should not allow path starting "|"

It was made obsolete long time ago.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-12-27 19:22:28 +09:00
parent 20606c4455
commit 830c882f06
+2 -6
View File
@@ -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