about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-02 16:13:23 -0400
committerJune McEnroe <june@causal.agency>2020-04-02 16:13:23 -0400
commit2d36c4d7c9aebb9bd1b70b73956edcb81199c587 (patch)
tree09d4b584703dab242a75aed3e2a5380cf216abfa
parentGenerate short option string with a loop (diff)
downloadcatgirl-2d36c4d7c9aebb9bd1b70b73956edcb81199c587.tar.gz
catgirl-2d36c4d7c9aebb9bd1b70b73956edcb81199c587.zip
Use a for loop for getopt
-rw-r--r--chat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/chat.c b/chat.c
index 22c5665..ea6e0c4 100644
--- a/chat.c
+++ b/chat.c
@@ -159,8 +159,7 @@ int main(int argc, char *argv[]) {
 		if (options[i].has_arg) opts[j++] = ':';
 	}
 
-	int opt;
-	while (0 < (opt = getopt_config(argc, argv, opts, options, NULL))) {
+	for (int opt; 0 < (opt = getopt_config(argc, argv, opts, options, NULL));) {
 		switch (opt) {
 			break; case '!': insecure = true;
 			break; case 'C': utilPush(&urlCopyUtil, optarg);
3 19:48:15 -0400'>2018-08-03Use a wide pad for the topicJune McEnroe 2018-08-03Ignore NOTICEs not sent to the channelJune McEnroe 2018-08-03Handle KICK and NICKJune McEnroe 2018-08-03Continue on EINTR from pollJune McEnroe Resizing the terminal causes it. 2018-08-03Handle ACTIONsJune McEnroe 2018-08-03Use more octal char literalsJune McEnroe I might be coming around to octal. 2018-08-03Send a WHO in response to NAMES to get usernamesJune McEnroe Other than this slight hack, I think coloring by username rather than nick is a much better idea. 2018-08-03Colorize nicks and channelsJune McEnroe 2018-08-03Add support for mIRC colorsJune McEnroe 2018-08-03Handle bold, italic, underlineJune McEnroe 2018-08-03Add prift function for "prefix shift"June McEnroe Forgive me. 2018-08-03Link with -lcurseswJune McEnroe 2018-08-02Use libtls "compat" ciphersJune McEnroe irc.mozilla.org, using GnuTLS, doesn't support *any* of the "secure" ciphers! 2018-08-02Add UI and handle some kinds of server messagesJune McEnroe Seems like handling input is going to be the worst thing ever. 2018-08-02Add chroot.tar targetJune McEnroe