Skip to content

released at 0.3.3 #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 3 additions & 15 deletions kirc.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* SPDX-License-Identifier: MIT
* Copyright (C) 2023 Michael Czigler
* Copyright (C) 2025 Michael Czigler
*/

#include "kirc.h"
Expand Down Expand Up @@ -1839,7 +1839,6 @@ int main(int argc, char **argv)
dcc_dir = optarg;
break;
case 'x':
cmds = 1;
inic = argv[optind];
break;
case '?':
Expand All @@ -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();
Expand All @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions kirc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)))
Expand Down