This test is done quite a bit across the tree, and the open-coded variants make it easy to have an
accidental mismatch between the length of the prefix being tested and the length actually passed to
strncmp().
This fixes an issue of that type comparing the server version against the prefix "u2.10", where the old
code used an incorrect length of 4.
Previously you could unset CMDCHARS and the effect would be to treat it like it was set to DEFAULT_CMDCHARS,
except that some code was missing the fallback (eg. ignore_last_nick()) which would make it crash.
Instead of having the fallback everywhere, just make it so that you can't unset the variable - if you try, it
sets it to DEFAULT_CMDCHARS. This reflects what the behaviour has always been, it just makes it explicit to
the user and the bonus is we don't have the test it for NULL everywhere.
This aligns the function with the documentation and what EPIC4/5 do. I couldn't find any example of an existing
script that actually called this function, so hopefully no-one is relying on the old behaviour.
This replaces calls to alloca() followed by two strcpy()s with a single
call to memmove(), and removes a confusing for/break structure.
The function should behave exactly as it did before.
get_reason() is then used only for the implementation of get_kick_reason()
and for the $getreason() scripting function. Add current nick as an
explicit argument for get_reason(), which pushes all use of from_server
out of the ransom reason functions.
Also switch a few instances of send_to_server() to my_send_to_server() where
the current server has been returned by prepare_command().
Affected functions are alias_idle(), alias_serverlag(), alias_awaytime(),
function_serverpass(), function_checkuser() and function_isuser().
This fixes $serverpass(), which seems to have never worked right.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@470 13b04d17-f746-0410-82c6-800466cd88b0
This fixes a series of compiler warnings on netbsd i386.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@465 13b04d17-f746-0410-82c6-800466cd88b0
Also rework function to use snprintf() instead of sprintf().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@464 13b04d17-f746-0410-82c6-800466cd88b0
scripting function - this allows alternate hashing methods to be selected
if supported by the C library.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@361 13b04d17-f746-0410-82c6-800466cd88b0
client purposes. The RANDOM_SOURCE setting now only affects the $rand()
scripting function.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@357 13b04d17-f746-0410-82c6-800466cd88b0
case-insensitive filesystems like NTFS or HFS+, where it clashes with
the BitchX binary.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@204 13b04d17-f746-0410-82c6-800466cd88b0
never worked properly. Search LOAD_PATH for the SCRIPT_HELP file.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@128 13b04d17-f746-0410-82c6-800466cd88b0
Use correct define for PUBLIC_ACCESS.
Some cleanups - separate out help index freeing, change get_help_topic() to return
void.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@127 13b04d17-f746-0410-82c6-800466cd88b0
per-server, and apply new version of do_oops from flewid (the BX2 version).
This means that /oops, "/query .", "/query ,", "/msg ." and "/msg ," are now
per-server, along with the $. $, and $B aliases.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@87 13b04d17-f746-0410-82c6-800466cd88b0
you gave it, it would return the first server in the list
where server.itsname == server.name, due to a misplaced
variable. It also returned an empty string for
$servernum( ) when it should return the current server.
Also removed the useless function_serverport() function -
it was a character-for-character duplicate of
function_servports().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@70 13b04d17-f746-0410-82c6-800466cd88b0
like x86-64, where sizeof(int) != sizeof (void *). This involves correctly
casting every function pointer from the global table to the correct
function type, which has the added benefit of allowing type-checking of
function arguments and return values.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@26 13b04d17-f746-0410-82c6-800466cd88b0