File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -510,12 +510,7 @@ def write(string)
510
510
end
511
511
end
512
512
513
- def print ( string )
514
- if $VERBOSE
515
- $stderr. puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.'
516
- $stderr. puts ' cf. Telnet#puts().'
517
- end
518
- string = string + "\n "
513
+ def _print ( string )
519
514
string = string . gsub ( /#{ IAC } /no , IAC + IAC ) if @options [ "Telnetmode" ]
520
515
521
516
if @options [ "Binmode" ]
@@ -535,7 +530,15 @@ def print(string)
535
530
end
536
531
537
532
def puts ( string )
538
- self . print ( string )
533
+ self . _print ( string + "\n " )
534
+ end
535
+
536
+ def print ( string )
537
+ if $VERBOSE
538
+ $stderr. puts 'WARNING: Telnet#print("string") NOT adds "\n" to the last of "string", in the future.'
539
+ $stderr. puts ' cf. Telnet#puts().'
540
+ end
541
+ self . puts ( string )
539
542
end
540
543
541
544
def cmd ( options )
@@ -550,7 +553,7 @@ def cmd(options)
550
553
string = options
551
554
end
552
555
553
- self . print ( string )
556
+ self . puts ( string )
554
557
if iterator?
555
558
waitfor ( { "Prompt" => match , "Timeout" => time_out } ) { |c | yield c }
556
559
else
You can’t perform that action at this time.
0 commit comments