[PATCH 56/65] cleanup

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun, 5 Jul 2015 22:44:22 +0200

---
 ii.c | 40 +++++++++++++---------------------------
 1 file changed, 13 insertions(+), 27 deletions(-)
diff --git a/ii.c b/ii.c
index 8474f84..31a27f5 100644
--- a/ii.c
+++ b/ii.c
_AT_@ -359,7 +359,7 @@ tcpopen(const char *host, const char *service)
 	hints.ai_socktype = SOCK_STREAM;
 
 	if((e = getaddrinfo(host, service, &hints, &res)))
-		eprintf("ii: getaddrinfo() failed : %s\n", gai_strerror(e));
+		eprintf("ii: getaddrinfo() failed: %s\n", gai_strerror(e));
 
 	for (rp = res; rp; rp = rp->ai_next) {
 		fd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
_AT_@ -532,12 +532,6 @@ proc_server_cmd(int fd, char *buf)
 	for(i = 0; i < TOK_LAST; i++)
 		argv[i] = NULL;
 
-#if 1
-	/* DEBUG */
-	printf("server cmd str: |%s|\n", buf);
-	fflush(stdout);
-#endif
-
 	/* check prefix */
 	if(buf[0] == ':') {
 		if (!(p = strchr(buf, ' ')))
_AT_@ -567,17 +561,6 @@ proc_server_cmd(int fd, char *buf)
 
 	tokenize(&argv[TOK_CMD], TOK_LAST - TOK_CMD, cmd, ' ');
 
-#if 1
-	/* DEBUG */
-	printf("server cmd: TOK_NICKSRV |%s|\n", argv[TOK_NICKSRV]);
-	printf("server cmd: TOK_USER    |%s|\n", argv[TOK_USER]);
-	printf("server cmd: TOK_CMD     |%s|\n", argv[TOK_CMD]);
-	printf("server cmd: TOK_CHAN    |%s|\n", argv[TOK_CHAN]);
-	printf("server cmd: TOK_ARG     |%s|\n", argv[TOK_ARG]);
-	printf("server cmd: TOK_TEXT    |%s|\n", argv[TOK_TEXT]);
-	fflush(stdout);
-#endif
-
 	if(!argv[TOK_CMD] || !strcmp("PONG", argv[TOK_CMD])) {
 		return;
 	} else if(!strcmp("PING", argv[TOK_CMD])) {
_AT_@ -758,28 +741,31 @@ main(int argc, char *argv[])
 	char prefix[PATH_MAX];
 	int ircfd;
 
-	/* use nickname and home dir of user for ii by default */
+	/* use nickname and home dir of user by default */
 	if(!(spw = getpwuid(getuid())))
 		eprintf("ii: getpwuid() failed:");
 	strlcpy(nick, spw->pw_name, sizeof(nick));
 	snprintf(prefix, sizeof(prefix), "%s/irc", spw->pw_dir);
 
 	ARGBEGIN {
+	case 'f':
+		fullname = EARGF(usage());
+		break;
 	case 'i':
 		strlcpy(prefix, EARGF(usage()), sizeof(prefix));
 		break;
-	case 's':
-		host = EARGF(usage());
+	case 'k':
+		key = getenv(EARGF(usage()));
+		break;
+	case 'n':
+		strlcpy(nick, EARGF(usage()), sizeof(nick));
 		break;
 	case 'p':
 		service = EARGF(usage());
 		estrtol(service, 10);
 		break;
-	case 'n':
-		strlcpy(nick, EARGF(usage()), sizeof(nick));
-		break;
-	case 'k':
-		key = getenv(EARGF(usage()));
+	case 's':
+		host = EARGF(usage());
 		break;
 	case 'u':
 		uds = EARGF(usage());
_AT_@ -789,7 +775,7 @@ main(int argc, char *argv[])
 		break;
 	} ARGEND;
 
-	if(!*host || !*nick)
+	if(!*host)
 		usage();
 
 	if(uds[0])
-- 
2.4.10
--Multipart=_Mon__9_May_2016_17_21_10_+0200_I.6cpFVydhq75aaE
Content-Type: text/x-diff;
 name="0057-clear-timeval-struct-don-t-use-invalid-wrset.patch"
Content-Disposition: attachment;
 filename="0057-clear-timeval-struct-don-t-use-invalid-wrset.patch"
Content-Transfer-Encoding: 7bit
Received on Mon Sep 17 2001 - 00:00:00 CEST

This archive was generated by hypermail 2.3.0 : Mon May 09 2016 - 17:24:22 CEST