avoid redundant newline trailer in tcp responses

This commit is contained in:
stefan schippers 2023-04-07 23:50:04 +02:00
parent 705f279a23
commit c98f0afec5
1 changed files with 1 additions and 5 deletions

View File

@ -1270,11 +1270,7 @@ proc xschem_getdata {sock} {
rename puts {}
rename ::tcl::puts puts
puts "tcp--> $tclcmd_puts"
if {![regexp {\n$} $tclcmd_puts]} {
set xschem_server_getdata(res,$sock) "$tclcmd_puts\n"
} else {
set xschem_server_getdata(res,$sock) "$tclcmd_puts"
}
set xschem_server_getdata(res,$sock) "$tclcmd_puts"
puts -nonewline $sock "$xschem_server_getdata(res,$sock)"
flush $sock
close $sock ;# server closes