Skip to content

Commit

Permalink
wakou
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
wakou committed Sep 11, 2000
1 parent 410820a commit 6d090b5
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/net/telnet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -510,12 +510,7 @@ def write(string)
end
end

def print(string)
if $VERBOSE
$stderr.puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.'
$stderr.puts ' cf. Telnet#puts().'
end
string = string + "\n"
def _print(string)
string = string.gsub(/#{IAC}/no, IAC + IAC) if @options["Telnetmode"]

if @options["Binmode"]
Expand All @@ -535,7 +530,15 @@ def print(string)
end

def puts(string)
self.print(string)
self._print(string + "\n")
end

def print(string)
if $VERBOSE
$stderr.puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.'
$stderr.puts ' cf. Telnet#puts().'
end
self.puts(string)
end

def cmd(options)
Expand All @@ -550,7 +553,7 @@ def cmd(options)
string = options
end

self.print(string)
self.puts(string)
if iterator?
waitfor({"Prompt" => match, "Timeout" => time_out}){|c| yield c }
else
Expand Down

0 comments on commit 6d090b5

Please sign in to comment.