diff --git a/src/wirc.cgi/wirc.cgi.go b/src/wirc.cgi/wirc.cgi.go index 5318556..1bc04a4 100644 --- a/src/wirc.cgi/wirc.cgi.go +++ b/src/wirc.cgi/wirc.cgi.go @@ -30,7 +30,9 @@ func ReadString(fn string) string { } func tail(w http.ResponseWriter, pos int64) { - f, err := os.Open(path.Join(ServerDir, "log")) + logfn := path.Join(ServerDir, "log") + + f, err := os.Open(logfn) if err != nil { log.Fatal(err) } @@ -41,6 +43,7 @@ func tail(w http.ResponseWriter, pos int64) { log.Fatal(err) } defer watcher.Close() + watcher.Add(logfn) for { printid := false diff --git a/src/wirc/wirc.go b/src/wirc/wirc.go index f61b979..8ae72ff 100644 --- a/src/wirc/wirc.go +++ b/src/wirc/wirc.go @@ -27,6 +27,10 @@ var gecos string var logq chan Message func isChannel(s string) bool { + if (s == "") { + return false + } + switch s[0] { case '#', '&', '!', '+', '.', '-': return true