aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Czigler <37268479+mcpcpc@users.noreply.github.com>2025-01-13 09:39:05 -0500
committerGitHub <noreply@github.com>2025-01-13 09:39:05 -0500
commit61bce2bc9fd8d8e5dac8435912a1a5e9513873b8 (patch)
tree0c44260d01e9cb12e1ffcc5ba04c0adaf91fa5c2
parentremove some magic numbers, clean up DCC ipv4/ipv6 global variable mess and us... (diff)
downloadkirc-61bce2bc9fd8d8e5dac8435912a1a5e9513873b8.tar.gz
kirc-61bce2bc9fd8d8e5dac8435912a1a5e9513873b8.tar.bz2
kirc-61bce2bc9fd8d8e5dac8435912a1a5e9513873b8.tar.xz
kirc-61bce2bc9fd8d8e5dac8435912a1a5e9513873b8.tar.zst
kirc-61bce2bc9fd8d8e5dac8435912a1a5e9513873b8.zip
released at 0.3.2 (#145)
-rw-r--r--LICENSE2
-rw-r--r--kirc.c18
-rw-r--r--kirc.h5
3 files changed, 5 insertions, 20 deletions
diff --git a/LICENSE b/LICENSE
index 829a649..370e4e9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2021-2023 Michael Czigler
+Copyright (c) 2021-2025 Michael Czigler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/kirc.c b/kirc.c
index 53671d0..b542d9a 100644
--- a/kirc.c
+++ b/kirc.c
@@ -1,6 +1,6 @@
/*
* SPDX-License-Identifier: MIT
- * Copyright (C) 2023 Michael Czigler
+ * Copyright (C) 2025 Michael Czigler
*/
#include "kirc.h"
@@ -1839,7 +1839,6 @@ int main(int argc, char **argv)
dcc_dir = optarg;
break;
case 'x':
- cmds = 1;
inic = argv[optind];
break;
case '?':
@@ -1850,12 +1849,6 @@ int main(int argc, char **argv)
if (dcc) {
sigaction(SIGPIPE, &(struct sigaction){.sa_handler = SIG_IGN}, NULL);
}
- if (cmds) {
- int flag = 0;
- for (int i = 0; i < CBUF_SIZ && flag > -1; i++) {
- flag = read(STDIN_FILENO, &cbuf[i], 1);
- }
- }
if (!nick) {
fputs("Nick not specified\n", stderr);
usage();
@@ -1875,13 +1868,8 @@ int main(int argc, char **argv)
if (pass) {
raw("PASS %s\r\n", pass);
}
- if (cmds > 0) {
- for (char *tok = strtok(cbuf, "\n"); tok; tok = strtok(NULL, "\n")) {
- raw("%s\r\n", tok);
- }
- if (inic) {
- raw("%s\r\n", inic);
- }
+ if (inic) {
+ raw("%s\r\n", inic);
}
for (int i = 0; i < CON_MAX; i++) {
slot_clear(i);
diff --git a/kirc.h b/kirc.h
index cb59e77..2170fb8 100644
--- a/kirc.h
+++ b/kirc.h
@@ -8,7 +8,7 @@
#define _POSIX_C_SOURCE 200809L
#define CTCP_CMDS "ACTION VERSION TIME CLIENTINFO PING DCC"
-#define VERSION "0.3.2"
+#define VERSION "0.3.3"
#define TESTCHARS "\xe1\xbb\xa4"
#define MSG_MAX 512 /* irc rfc says lines are 512 char's max, but servers can accept more */
#define CHA_MAX 200
@@ -22,7 +22,6 @@
#define POLL_TIMEOUT 180000 /* 3 minutes */ /* argument is in miliseconds */
#define CON_MAX 20
#define BACKLOG 100 /* DCC SEND listen() backlog */
-#define CBUF_SIZ 1024
#define DCC_FLAGS (O_WRONLY | O_APPEND)
#define DCC_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
#define STR_(a) #a
@@ -69,8 +68,6 @@ static char *auth = NULL; /* PLAIN SASL token */
static char *real = NULL; /* real name */
static char *olog = NULL; /* chat log path */
static char *inic = NULL; /* additional server command */
-static char cmds = 0; /* indicates additional server commands */
-static char cbuf[CBUF_SIZ]; /* additional stdin server commands */
/* define function macros */
#define htonll(x) ((1==htonl(1)) ? (x) : (((uint64_t)htonl((x) & 0xFFFFFFFFUL)) << 32) | htonl((uint32_t)((x) >> 32)))