about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--chat.c1
-rw-r--r--chat.h1
-rw-r--r--irc.c6
3 files changed, 8 insertions, 0 deletions
diff --git a/chat.c b/chat.c
index dbd2784..284302d 100644
--- a/chat.c
+++ b/chat.c
@@ -269,5 +269,6 @@ int main(int argc, char *argv[]) {
 	};
 	handle(msg);
 
+	ircClose();
 	uiHide();
 }
diff --git a/chat.h b/chat.h
index fb7bf61..f0dc6cb 100644
--- a/chat.h
+++ b/chat.h
@@ -130,6 +130,7 @@ void ircRecv(void);
 void ircSend(const char *ptr, size_t len);
 void ircFormat(const char *format, ...)
 	__attribute__((format(printf, 1, 2)));
+void ircClose(void);
 
 extern struct Replies {
 	size_t join;
diff --git a/irc.c b/irc.c
index 3ecc582..dd36f10 100644
--- a/irc.c
+++ b/irc.c
@@ -273,3 +273,9 @@ void ircRecv(void) {
 	len -= line - buf;
 	memmove(buf, line, len);
 }
+
+void ircClose(void) {
+	int error = tls_close(client);
+	if (error) errx(EX_IOERR, "tls_close: %s", tls_error(client));
+	tls_free(client);
+}
span title='2019-02-18 19:27:46 -0500'>2019-02-18Match whitespace between * [] {}June McEnroe 2019-02-18Fix function-like #define regexJune McEnroe A define like #define FOO (1) is not function-like. 2019-02-18Match Tag in RustJune McEnroe 2019-02-18Match sh functions as TagJune McEnroe 2019-02-18Match Sh and Ss as Tag in mdocJune McEnroe 2019-02-18Match statics and typedefs as TagJune McEnroe 2019-02-18Clean up htmlHeaderJune McEnroe 2019-02-18Remove hi line numberingJune McEnroe Tags are much better for referring to specific parts of a file and line numbering is better done by a post-processing tool such as cat -n or producing a two-column HTML <table>. 2019-02-18Add Tag class to hiJune McEnroe 2019-02-17Generate HTML with hi -n -f html -o anchorJune McEnroe Running hi twice to insert stuff between the head and the content is a bit of a hack but oh well. 2019-02-17Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe Renames previous -n option to -m to stay consistent with cat -n. Prefixing lines with line numbers affects where the first tab indent ends up relative to the text above it. Not sure if it's worth fixing somehow. 2019-02-17Always split spans after newlinesJune McEnroe Simplifies ANSI and IRC output code, and prepares for line numbered output. 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroe