The old code could move the variable 'pointer' backwards one character before the start
of the string (then incremented it again before returning). Formally this is undefined
behaviour, so fix it.
The removed variables are:
dll_functions
dll_numeric
dll_commands
dll_variable
dll_ctcp
dll_window
These are not actually directly used by any modules, and hiding them allows us to more easily
change their implementation later.
This helper function is for modules to save the contents of their module variables to a file
as SET commands.
It will remove the need to export the raw dll_variable list to modules.
This error seemed to be benign, because I don't think there was a way to get here with
int_flags non-zero without VIF_CHANGED already set.
Remove unnecessary tests for 'value' and '!value', because value is always non-NULL in that
code path.
As reported by Ancient, this is how it is documented to work. It's also how shitlist level 2 works, so
it's consistent this way.
Some other cleanups in check_auto() while we're here.
A fractional-second timeout was already supported for the initial timeout of a /TIMER, but
if the timer was recurring then the interval was rounded to a whole number of seconds for
the subsequent timeouts.
Change the type of interval from long to double to fix this.
These globals were used to store the original terminal dimesions from the terminal database (or
in the case of reattaching, supplied by scr-bx) to be applied if the current terminal dimensions
could not be determined.
Instead, we leave the original terminal dimensions in current_term->TI_lines and current_term->TI_cols,
and create current_term->li and current_term->co to store the current terminal dimensions (as eg.
supplied by scr-bx).
Separate out the justification step of make_status() into a new function, so it can be wired in to
stat_convert_format() as well. This makes $statsparse() work correctly with right-justified status
formats.
Minimise the amount of copying around that is done during the justification - instead, we can just
remember pointers into the buffer returned by strip_ansi() for the left-hand-side, right-hand-side and
padding character.
Don't keep concatenating onto the same buffer with strlcat() when generating the padding - that gives
n^2 behaviour. Instead keep a pointer to the current end and concatenate there.
Ensure buffer is null-terminated before calling strlcat() on it, in stat_convert_format().
With this change, the signal handler signature is defined in only one place.
Also make most signal handler functions static (those that are only referred to in irc.c).
CLOSING_SERVER was never referenced outside of server.h where it's defined, and CLOSE_PENDING was cleared
but never set by any code.
Rename LOGGED_IN to namespace it (in anticipation of other flag variables in the server struct being
consolidated into a set of server flags).
Also put correct parantheses around the definition of SF_LOGGED_IN.
The guts of this function doesn't need to be in server.c - it only uses extern server functions so it
makes sense just to move it into the body of function_servers(), the only caller.
That means it's no longer accessible for loadable modules, but it isn't much use for them anyway. They
can always directly access the server list if they need that info.
(Requires rolling the module table version).
When $myservers() is called with an argument of 1 it is supposed to only return the refnums of servers
that are registered (ie. those which it is legal to send a command to). This is the way EPIC works, and
it was always intended to work this way in BX too.
Also fix the warning about a NULL itsname - we use our name for the server if it isn't registered yet.
Remove the slightly bogus use of strncat() while we're here, by removing the temporary stack buffer and
just directly creating the result string with m_s3cat().
Remove the 'resend_only' flag option to fudge_nickname(). The only caller passing it was the CHANGE_NICK_ON_KILL
feature, and in that case it was the wrong thing too (and stopped that function from working at all).
Some other minor cleanups in fudge_nickname() while we're there.