bugfix
This commit is contained in:
parent
07c62eca88
commit
9c4c625dbf
1 changed files with 13 additions and 2 deletions
15
calc.c
15
calc.c
|
|
@ -244,7 +244,7 @@ static char *db_get(const char *key) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
static void db_close_cleanup(void) { if (db_handle) { db_close(DB); db_handle = NULL; } }
|
static void db_close_cleanup(void) { if (db_handle) { db_close(DB); db_handle = NULL; } }
|
||||||
#define OPENCODE_BIN "/home/recursion/.node_modules/opencode-ai/bin/opencode.exe"
|
#define OPENCODE_BIN "/home/armin/.local/bin/opencode"
|
||||||
#define AI_REPLY_MAX 400
|
#define AI_REPLY_MAX 400
|
||||||
static pid_t pending_ai_pid;
|
static pid_t pending_ai_pid;
|
||||||
static int ai_start(const char *question, const char *target, const char *nick) {
|
static int ai_start(const char *question, const char *target, const char *nick) {
|
||||||
|
|
@ -1080,13 +1080,24 @@ static void irc_handle(Session *s, const char *raw) {
|
||||||
chan_del_op(chans[i].name, src_nick);
|
chan_del_op(chans[i].name, src_nick);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (strcmp(cmd_buf, "NICK") == 0 && prefix) {
|
||||||
|
if (strcasecmp(src_nick, s->nick) == 0) {
|
||||||
|
const char *newnick = params;
|
||||||
|
if (*newnick == ':') newnick++;
|
||||||
|
strncpy(s->nick, newnick, sizeof s->nick - 1);
|
||||||
|
s->nick[sizeof s->nick - 1] = 0;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (strcmp(cmd_buf, "464") == 0) {
|
if (strcmp(cmd_buf, "464") == 0) {
|
||||||
log_stamp(); fprintf(stderr, CLR_RED "Password rejected" CLR_RESET "\n"); running = 0; return;
|
log_stamp(); fprintf(stderr, CLR_RED "Password rejected" CLR_RESET "\n"); running = 0; return;
|
||||||
}
|
}
|
||||||
if (strcmp(cmd_buf, "433") == 0 || strcmp(cmd_buf, "436") == 0) {
|
if (strcmp(cmd_buf, "433") == 0 || strcmp(cmd_buf, "436") == 0) {
|
||||||
char newnick[33]; /* 32-byte nick + '_' + NUL */
|
char newnick[33];
|
||||||
snprintf(newnick, sizeof newnick, "%s_", s->nick);
|
snprintf(newnick, sizeof newnick, "%s_", s->nick);
|
||||||
irc_nick(s, newnick);
|
irc_nick(s, newnick);
|
||||||
|
strncpy(s->nick, newnick, sizeof s->nick - 1);
|
||||||
|
s->nick[sizeof s->nick - 1] = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (strcmp(cmd_buf, "ERROR") == 0) {
|
if (strcmp(cmd_buf, "ERROR") == 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue