From 16e41aca8649876ef5207be0032508ed25a3db36 Mon Sep 17 00:00:00 2001 From: joonicks Date: Mon, 22 Sep 2025 16:40:16 +0200 Subject: [PATCH 1/2] postfix.sh for repeat compilers --- .gitignore | 1 + Makefile | 4 +++- configure | 10 +++++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 168fcc4..465f572 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ src/y src/z randdata test.conf +postfix.sh diff --git a/Makefile b/Makefile index eba9440..baa36ab 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # # EnergyMech, IRC Bot software -# Copyright (c) 1997-2018 proton +# Copyright (c) 1997-2025 proton # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,12 +86,14 @@ clean: install: $(MAKE) -C src install + test -x postfix.sh && ./postfix.sh mega: $(MAKE) -C src mega mega-install: $(MAKE) -C src mega-install + test -x postfix.sh && ./postfix.sh # # code validation tests diff --git a/configure b/configure index 2954db7..abd4abf 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #!/bin/sh # # EnergyMech, IRC Bot software -# Copyright (c) 1997-2018 proton +# Copyright (c) 1997-2025 proton # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1566,10 +1566,14 @@ if [ ! "$cores" = 1 ]; then $out "For speedy compiling, use \`\`make -j$cores''" fi $out '' -$out "Your chosen ./configure options have been saved to ./myconfig" +$out 'If you compile often and need to do repetitive extra operations after' +$out 'doing "make install", you can create "./postfix.sh" which will be executed' +$out 'after each "make install".' +$out '' +$out 'Your chosen ./configure options have been saved to ./myconfig' $out 'if you wish to save ./myconfig in its current state, chmod -w ./myconfig' $out '' -$out 'Submit your bugreports at https://github.com/MadCamel/energymech/issues' +$out 'Submit your bugreports at https://github.com/EnergyMech/energymech/issues' $out '' $out 'You have read the README file I hope?' $out '' From dd0529d5c703a13f10f925a622f1406600fd3813 Mon Sep 17 00:00:00 2001 From: joonicks Date: Mon, 22 Sep 2025 16:43:11 +0200 Subject: [PATCH 2/2] fixes .forget command issue #20, & shorter function name --- src/channel.c | 19 ++++++++----------- src/debug.c | 2 +- src/defines.h | 6 ------ src/gencmd.c | 2 +- src/h.h | 2 +- src/ons.c | 4 ++-- src/toybox.c | 10 +++++----- 7 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/channel.c b/src/channel.c index 3d1e8a7..05ce725 100644 --- a/src/channel.c +++ b/src/channel.c @@ -67,7 +67,7 @@ Chan *find_channel(const char *name, int anychannel) for(chan=current->chanlist;chan;chan=chan->next) { - if (chan->active < anychannel) + if (anychannel == 1 && chan->active == 0) continue; if (ni != tolowertab[(uchar)(chan->name[1])]) continue; @@ -757,24 +757,21 @@ begin: void do_forget(COMMAND_ARGS) { /* - * on_msg checks: CARGS + * on_msg checks: CAXS */ - Chan *chan; - char *channel; - channel = chop(&rest); /* cant be NULL (CARGS) */ - if ((chan = find_channel_ny(channel)) == NULL) + if (CurrentChan == NULL) { - to_user(from,"Channel %s is not in memory",channel); + to_user(from,"Unknown channel"); return; } - if (chan->active) + if (CurrentChan->active) { - to_user(from,"I'm currently active on %s",channel); + to_user(from,"I'm currently active on %s",CurrentChan->name); return; } - to_user(from,"Channel %s is now forgotten",channel); - remove_chan(chan); + to_user(from,"Channel %s is now forgotten",CurrentChan->name); + remove_chan(CurrentChan); } /* diff --git a/src/debug.c b/src/debug.c index a42c7ee..899900b 100644 --- a/src/debug.c +++ b/src/debug.c @@ -228,7 +228,7 @@ LS struct { check_telnet, "check_telnet" }, #endif /* TELNET */ #ifdef TOYBOX -{ read_bigcharset_callback, "read_bigcharset_callback" CMD1_SE }, +{ read_charset_callback, "read_charset_callback" CMD1_SE }, #endif /* TOYBOX */ #ifdef TRIVIA { trivia_check, "trivia_check" CMD1_SE }, diff --git a/src/defines.h b/src/defines.h index 7f2f51b..276195b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -374,12 +374,6 @@ enum { #define SP_NO_DNS 7 #define SP_THROTTLED 8 -/* find_channel() */ - -#define CH_ACTIVE 0x1 -#define CH_OLD 0x2 -#define CH_ANY 0x3 - /* check_mass() */ #define INDEX_FLOOD 0 diff --git a/src/gencmd.c b/src/gencmd.c index 5c34a38..b2dcb86 100644 --- a/src/gencmd.c +++ b/src/gencmd.c @@ -182,7 +182,7 @@ struct * Level 70 == JOINLEVEL */ { 0, "CYCLE", "do_cycle", 70 | CCPW | CAXS | ACCHAN }, - { 0, "FORGET", "do_forget", 70 | CCPW | CAXS | CARGS }, + { 0, "FORGET", "do_forget", 70 | CCPW | CAXS }, { 0, "JOIN", "do_join", 70 | CCPW | CARGS }, { 0, "KS", "do_kicksay", 70 | CCPW | REDIR | LBUF }, { 0, "PART", "do_part", 70 | CCPW | CAXS | ACCHAN }, diff --git a/src/h.h b/src/h.h index dc1dc63..9b2eaff 100644 --- a/src/h.h +++ b/src/h.h @@ -688,7 +688,7 @@ LS void do_tcl(COMMAND_ARGS) __page(CMD1_SEG); /* toybox.c */ -LS int read_bigcharset_callback(char *) __page(CMD1_SEG); +LS int read_charset_callback(char *) __page(CMD1_SEG); LS int read_bigcharset(char *) __page(CMD1_SEG); LS int read_ascii(char *) __page(CMD1_SEG); LS void trivia_week_toppers(void) __page(CMD1_SEG); diff --git a/src/ons.c b/src/ons.c index 4c0b6db..7d5cac8 100644 --- a/src/ons.c +++ b/src/ons.c @@ -604,8 +604,8 @@ recheck_alias: uaccess = get_authaccess(from,to); if (uaccess < acmd[i]) return; - CurrentChan = find_channel_ac(to); - if (mcmd[i].acchan && !CurrentChan) + CurrentChan = find_channel_ny(to); + if (mcmd[i].acchan && (CurrentChan == NULL || CurrentChan->active == 0)) { to_user(from,ERR_CHAN,to); return; diff --git a/src/toybox.c b/src/toybox.c index 8b92fff..2a1420e 100644 --- a/src/toybox.c +++ b/src/toybox.c @@ -69,7 +69,7 @@ int orig_charheight; int orig_spacewidth; int orig_kerning; -int read_bigcharset_callback(char *rest) +int read_charset_callback(char *rest) { char *opt; int *n,sz; @@ -98,9 +98,9 @@ int read_bigcharset_callback(char *rest) opt = chop(&rest); #ifdef DEBUG - debug("(read_bigcharset_callback) New character definition: %s\n",opt); + debug("(read_charset_callback) New character definition: %s\n",opt); #endif /* DEBUG */ - set_mallocdoer(read_bigcharset_callback); + set_mallocdoer(read_charset_callback); newchar = (BigC*)Calloc(sizeof(BigC) + strlen(opt)); newchar->next = fontlist; @@ -137,7 +137,7 @@ int read_bigcharset_callback(char *rest) return(TRUE); } Free((char**)&fontname); - set_mallocdoer(read_bigcharset_callback); + set_mallocdoer(read_charset_callback); fontname = stringdup(opt); } @@ -173,7 +173,7 @@ int read_bigcharset(char *fname) charheight = 0; kerning = 0; - readline(fd,&read_bigcharset_callback); /* readline closes fd */ + readline(fd,&read_charset_callback); /* readline closes fd */ /* * free the old font if there is one