Skip to content

Commit 61bce2b

Browse files
authored
released at 0.3.2 (#145)
1 parent cb595c5 commit 61bce2b

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021-2023 Michael Czigler
3+
Copyright (c) 2021-2025 Michael Czigler
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

kirc.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* SPDX-License-Identifier: MIT
3-
* Copyright (C) 2023 Michael Czigler
3+
* Copyright (C) 2025 Michael Czigler
44
*/
55

66
#include "kirc.h"
@@ -1839,7 +1839,6 @@ int main(int argc, char **argv)
18391839
dcc_dir = optarg;
18401840
break;
18411841
case 'x':
1842-
cmds = 1;
18431842
inic = argv[optind];
18441843
break;
18451844
case '?':
@@ -1850,12 +1849,6 @@ int main(int argc, char **argv)
18501849
if (dcc) {
18511850
sigaction(SIGPIPE, &(struct sigaction){.sa_handler = SIG_IGN}, NULL);
18521851
}
1853-
if (cmds) {
1854-
int flag = 0;
1855-
for (int i = 0; i < CBUF_SIZ && flag > -1; i++) {
1856-
flag = read(STDIN_FILENO, &cbuf[i], 1);
1857-
}
1858-
}
18591852
if (!nick) {
18601853
fputs("Nick not specified\n", stderr);
18611854
usage();
@@ -1875,13 +1868,8 @@ int main(int argc, char **argv)
18751868
if (pass) {
18761869
raw("PASS %s\r\n", pass);
18771870
}
1878-
if (cmds > 0) {
1879-
for (char *tok = strtok(cbuf, "\n"); tok; tok = strtok(NULL, "\n")) {
1880-
raw("%s\r\n", tok);
1881-
}
1882-
if (inic) {
1883-
raw("%s\r\n", inic);
1884-
}
1871+
if (inic) {
1872+
raw("%s\r\n", inic);
18851873
}
18861874
for (int i = 0; i < CON_MAX; i++) {
18871875
slot_clear(i);

kirc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#define _POSIX_C_SOURCE 200809L
1010
#define CTCP_CMDS "ACTION VERSION TIME CLIENTINFO PING DCC"
11-
#define VERSION "0.3.2"
11+
#define VERSION "0.3.3"
1212
#define TESTCHARS "\xe1\xbb\xa4"
1313
#define MSG_MAX 512 /* irc rfc says lines are 512 char's max, but servers can accept more */
1414
#define CHA_MAX 200
@@ -22,7 +22,6 @@
2222
#define POLL_TIMEOUT 180000 /* 3 minutes */ /* argument is in miliseconds */
2323
#define CON_MAX 20
2424
#define BACKLOG 100 /* DCC SEND listen() backlog */
25-
#define CBUF_SIZ 1024
2625
#define DCC_FLAGS (O_WRONLY | O_APPEND)
2726
#define DCC_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
2827
#define STR_(a) #a
@@ -69,8 +68,6 @@ static char *auth = NULL; /* PLAIN SASL token */
6968
static char *real = NULL; /* real name */
7069
static char *olog = NULL; /* chat log path */
7170
static char *inic = NULL; /* additional server command */
72-
static char cmds = 0; /* indicates additional server commands */
73-
static char cbuf[CBUF_SIZ]; /* additional stdin server commands */
7471

7572
/* define function macros */
7673
#define htonll(x) ((1==htonl(1)) ? (x) : (((uint64_t)htonl((x) & 0xFFFFFFFFUL)) << 32) | htonl((uint32_t)((x) >> 32)))

0 commit comments

Comments
 (0)