handle eof on stdin
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Apr 2005 14:45:02 +0000 (14:45 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Apr 2005 14:45:02 +0000 (14:45 +0000)
spoutchan.tcl

index cb601ab..b350563 100755 (executable)
@@ -19,6 +19,7 @@ proc msg_366 {args} {
 }
 proc stdinread {} {
     global channel
+    if {[eof stdin]} { exit 0 }
     if {[gets stdin l] < 0} return
     sendprivmsg $channel $l
 }