Commit Graph

417 Commits

Author SHA1 Message Date
Kevin Easton
03761ec715 Respin configure and defs.h.in for new configure.in, and update ircterm.h to match.
ircterm.h now includes ncurses/ncurses.h if present, which is necessary for Cygwin.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@438 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 12:00:08 +00:00
Kevin Easton
f2aa46e252 Add check for ncurses/ncurses.h to configure. This is where Cygwin installs ncurses.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@437 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 11:57:45 +00:00
Kevin Easton
ecabc12b3d Add helper macros to always call tparm() with 10 arguments.
This ensures portability to systems with a fixed-argument list declaration
of tparm(), like NetBSD curses.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@436 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 06:27:03 +00:00
Kevin Easton
0fe37326a3 Rebuild configure and defs.h.in from new configure.in, and update code to match.
This simplifies the inclusion logic in ircterm.h, and updates term.c to include
term.h if available.  This removes the declarations for setupterm(), tigetstr(),
tigetnum(), tigetflag(), tgetent(), tgetstr(), tgetnum() and tgetflag() from
term.c as those should be defined in term.h or termcap.h.

This should make the system declaration of tparm() available to term.c, which
will fix a crash on NetBSD x86-64 caused by the implicit declaration of tparm()
having a return type of 'int' while the real function has a return type of
'char *'.

We have to include term.h in term.c, not in ircterm.h because term.h defines
a large number of macros, at least two of which ('lines' and 'goto_window')
conflict with names in use in the rest of the codebase.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@435 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 05:38:06 +00:00
Kevin Easton
73c9947324 Rewrite the termcap/terminfo detection logic in configure.
The new logic is considerably shorter and simpler, and should mean that
terminfo is properly used in preference to termcap on NetBSD.  This also
allows us to include term.h in term.c, where the system definition of
tparm() lives on some systems (NetBSD is one such).

The new logic also means we link against libtinfo in preference to
libncurses, which should mean a little less memory used at runtime and a
fraction faster startup time.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@434 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-10 04:50:52 +00:00
Kevin Easton
96f1d64aa0 Change ircterm.h header include guard so that it doesn't clash with
the system term.h.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@433 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-09 11:04:30 +00:00
Tim Cava
112b38ac7a Revert the last commit. It accidentally had autogenerated files in it.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@432 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 03:00:24 +00:00
Tim Cava
276fd24258 Use snprintf rather than sprintf. From pvaldes.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@431 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-07 02:41:16 +00:00
Kevin Easton
590ae4c685 Further cleanups in dcc.c, removing unused variables and reworking dcc_exempt_save().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@430 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-06 10:35:16 +00:00
Kevin Easton
15894eb006 Some simplification / cleanup in dcc_glist().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@429 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-05 13:07:06 +00:00
Kevin Easton
456a0061f0 Fix output when client is built against termcap.
The pointer passed to tgetstr() must not be reset each time around the loop.
Also some other minor cleanups in term_init().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@428 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-01 13:06:02 +00:00
Tim Cava
8e8a4022f9 Cleanup check_serverlag(), with suggestions from caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@427 13b04d17-f746-0410-82c6-800466cd88b0
2013-11-01 11:32:57 +00:00
Kevin Easton
25dcf0709b Don't crash if the user gives a bogus status format with too many elements.
Replace unused .format_var member of status_expandos list with .args. For
expandos which have a subformat, this stores how many arguments are passed to
sprintf() when the subformat is expanded in the callback function.  The
convert_sub_format() function then uses this to limit the number of %s
conversion specifiers it creates in the converted subformat.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@426 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-30 13:09:03 +00:00
Kevin Easton
02327eebae Fix STATUS_NOTIFY so that it appears in the right window.
The old code was reusing the 'window' variable, which means that it
could pick up the STATUS_NOTIFY format from the wrong window.  You
would only have noticed this if you have windows with different settings
for STATUS_NOTIFY.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@425 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-29 13:25:10 +00:00
Kevin Easton
e9d180f526 Improve handling of padding in status formats.
Status formats support a %<PAD>c syntax for specifying padding.  This change
ensures that we only use padding consisting of the characters "0123456789.",
which ensures it won't confuse sprintf.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@424 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-29 13:14:19 +00:00
Kevin Easton
e281537918 logfile should be initialised from LOGFILE_VAR if that is set.
We can also rearrange things to remove the need for the add_ext variable,
hopefully also making the logic a bit more clear.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@423 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-27 15:08:23 +00:00
Tim Cava
6094d62550 Cleanup window_help(). Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@422 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 16:43:49 +00:00
Tim Cava
37f59831a2 Refactor window_log(). Use strlcat rather than strmcat. Rename a variable
and remove a buffer on the stack.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@421 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 15:30:09 +00:00
Tim Cava
9a5f10b8c5 Oops. nick must be initialized before old_uh, since it's passed to
fetch_userhost().


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@420 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 15:16:36 +00:00
Tim Cava
0cf0cf1ec4 Cleanup userhostbase. Use strlcat rather than strmcat. Rename some variables.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@419 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 15:03:12 +00:00
Tim Cava
9d562a6225 Cleanup convert_flags() a little bit.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@418 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 13:12:08 +00:00
Tim Cava
a0faae3e62 Cleanup convert_flags_to_str() a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@417 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 13:09:29 +00:00
Tim Cava
41dcaad142 Cleanup check_on_hook(). Use strlcat rather than strmcat. Don't
initialize variables unless necessary.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@416 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:54:04 +00:00
Tim Cava
1d1cd09ee3 Cleanup status_notify_windows() a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@415 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:43:57 +00:00
Tim Cava
e9ef2d4e55 Use strlcat, rather than strmcat, in make_status(). Remove a block of unused
ifdefed out code.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@414 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:34:25 +00:00
Tim Cava
fdb83238de Cleanup stat_convert_format() a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@413 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:28:13 +00:00
Tim Cava
26e070565e Use strlcat, rather than strmcat, in fix_status_buffer(). Remove unused
blocks of ifdeffed out code.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@412 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:20:19 +00:00
Tim Cava
95235006ab Cleanup convert_sub_format() a little bit. Use strlcat rather than strmcat.
Remove a variable that had no affect.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@411 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 02:12:42 +00:00
Tim Cava
a3ab6659fc Refactor vsend_to_server() with help from caf.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@410 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-26 00:49:30 +00:00
Tim Cava
eebdc6fb96 Cleanup set_operview_flags(). Rename old to old_flags to use the same
variable name across functions. Use strlcat rather than strmcat.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@409 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-23 17:51:09 +00:00
Tim Cava
b978b76bb7 Cleanup s_watch().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@408 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-23 17:44:20 +00:00
Tim Cava
07cdd587b4 Cleanup ircop_flags_to_str. Make the bufsize IRCD_BUFFER_SIZE instead of
BIG_BUFFER_SIZE. Even with many flags enabled the output string shouldn't
be larger than 512 bytes. Use strlcat rather than strmcat.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@407 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-23 17:33:50 +00:00
Tim Cava
809dc2f727 Cleanup create_channel_list a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@406 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-23 15:49:02 +00:00
Tim Cava
b12e865b9b Cleanup bits_to_lastlog_level a little bit. Use strlcat rather than strmcat.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@405 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-23 14:48:45 +00:00
Tim Cava
95a7534c8c Use strlcat, rather than strmcat, in BX_path_search.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@404 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-23 14:35:37 +00:00
Tim Cava
57020a48e7 Use strlcat, rather than strmcat, in get_userhost().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@403 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-20 18:40:18 +00:00
Tim Cava
22a4c1d9fb Use strlcat, rather than strmcat, in tab_completion().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@402 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-20 18:38:44 +00:00
Tim Cava
bfb9dc3d54 Use strlcat, rather than strmcat, in the definition of HANDLE_TYPE().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@401 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-20 18:32:07 +00:00
Tim Cava
faa052b597 Use strlcat, rather than strmcat, in ignore_list().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@400 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-20 18:20:05 +00:00
Tim Cava
559dfdd278 Use strlcat, rather than strmcat, in fill_it_out().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@399 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-19 20:52:37 +00:00
Tim Cava
12d3fadfb1 Use strlcat, rather than strmcat, in expand_twiddle().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@398 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-19 20:10:19 +00:00
Kevin Easton
c9260b61d3 Fix typo reported by nesta.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@397 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-16 22:27:23 +00:00
Kevin Easton
933478d7b1 Rename cavlink's randm() function to cav_randm() so that it doesn't clash with
the definition from ircaux.h.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@396 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-16 11:59:36 +00:00
Kevin Easton
a5bfc81b04 Fix typo bufer -> buffer.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@395 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-16 11:58:14 +00:00
Kevin Easton
751c53678d Use sizeof instead of size constant when passing buffers to getcwd().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@394 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-14 14:13:42 +00:00
Kevin Easton
69109d9045 Ensure that crypt_msg always leaves space for the trailing CTCP delimiter.
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@393 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-14 14:10:26 +00:00
Kevin Easton
86d47f06ce Fix behaviour of /XDEBUG with no arguments (based on EPIC).
Previously it would carefully construct a string, then do nothing with it.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@392 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-14 14:02:09 +00:00
Tim Cava
f5ef9ae80d Use strlcat, rather than strmcat, in function_ftime().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@391 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-13 20:28:11 +00:00
Tim Cava
501d960800 Use strlcat, rather than strmcat, in function_fsize().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@390 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-13 20:26:23 +00:00
Tim Cava
a8db6437aa Use strlcat, rather than strmcat, in function_fexist().
git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@389 13b04d17-f746-0410-82c6-800466cd88b0
2013-10-13 20:24:12 +00:00