From 30ea02aff1953ac948f6f0412ee352f1a66ac853 Mon Sep 17 00:00:00 2001 Message-Id: <30ea02aff1953ac948f6f0412ee352f1a66ac853.1715889876.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sun, 12 Aug 2001 15:37:15 +0000 Subject: [PATCH] Catch errors in onread and fail. Organization: Straylight/Edgeware From: Ian Jackson --- irccore.tcl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/irccore.tcl b/irccore.tcl index 04eccff..1721cec 100644 --- a/irccore.tcl +++ b/irccore.tcl @@ -166,7 +166,9 @@ proc bgerror {msg} { proc onread {args} { global sock nick calling_nick errorInfo errorCode line_org_endchar - if {[gets $sock line] == -1} { fail "EOF/error on input" } + if {[catch { gets $sock line } rv]} { fail "error on input: $rv" } + if {$rv == -1} { fail "EOF on input" } + set line_org_endchar [string range $line end end] regsub -all "\[^ -\176\240-\376\]" $line ? line set org $line -- [mdw]