1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-08 04:26:01 -04:00
Commit Graph

846 Commits

Author SHA1 Message Date
Xavier G
21c07c0060 Leverage string_policy(). 2016-05-13 02:27:19 +02:00
Xavier G
2c8648a9c8 Introduce string_policy(). 2016-05-13 02:10:02 +02:00
Xavier G
b0afcc96db Rename advance() into string_advance(). 2016-05-13 01:52:37 +02:00
Xavier G
5c74a3bb88 Move advance() from fe-common/core to core. 2016-05-13 01:39:14 +02:00
Xavier G
5538578820 Move utf8.{h,c} from fe-common/core to core. 2016-05-13 01:26:33 +02:00
dequis
2ba4b9d26a net_gethosterror: Handle EAI_SYSTEM ("System error") properly
That error code means "check errno". A few users got it and we never
figured out what happened - it usually fixed itself after restarting
something - so hopefully with this we'll have more information the next
time.
2016-04-07 07:26:19 -03:00
LemonBoy
e5ee243ab6 Simplify some logic in server_create_conn 2016-03-22 15:45:08 +01:00
LemonBoy
6745dd6159 Throw an error when a chatnet has no available url
If you type /connect <CN> and the chatnet <CN> has no url available
let's just throw an error instead of trying to process <CN> as a url.
2016-03-19 14:04:53 +01:00
TheLemonMan
795b7de808 Merge pull request #439 from horgh/ssl-errors
Clear error queue before SSL I/O operations
2016-03-17 22:07:57 +01:00
KindOne
bcebed5a72 Replace spaces with tabs 2016-03-14 21:23:37 -04:00
Jari Matilainen
27c37cb3f3 Return -1 from null-test to comply with the rest of strarray_find 2016-03-14 22:17:17 +01:00
Will Storey
8ab6bdf2ce Add clear error calls to irssi_ssl_get_iochannel 2016-03-13 15:09:52 -07:00
Will Storey
be733d2482 Clear error queue before SSL I/O operations
Otherwise we can see errors that are not related to the operation
we check for. SSL_get_error() inspects the thread's error queue.
See https://www.openssl.org/docs/manmaster/ssl/SSL_get_error.html for
more information.
2016-03-13 13:28:04 -07:00
ailin-nemui
af229a8bb7 Merge pull request #410 from LemonBoy/getaddrinfo-v6-flag
Getaddrinfo v6 flag
2016-02-03 11:45:11 +01:00
LemonBoy
0cc8276e89 Add AI_ADDRCONFIG to the getaddrinfo hints.
A first step to untangle the ipv4 vs ipv6 mess.
At the time of writing Linux, OpenBSD and FreeBSD all support the
AI_ADDRCONFIG flag.
2016-01-27 16:16:27 +01:00
LemonBoy
118eb0a68c Call getnameinfo with NI_NAMEREQD flag.
This way net_gethostbyaddr will fail when the system is unable to
resolve the address to a valid host name.
Without this flag in case of failure the function would return the ip
address instead of failing.
2016-01-27 15:54:29 +01:00
LemonBoy
f31b2026b4 Minor style fix in net_ip2host. 2016-01-27 15:04:07 +01:00
LemonBoy
87c0827471 Delete the HAVE_IPV6 ifdef.
Welcome to the future.
2016-01-27 14:31:55 +01:00
LemonBoy
eba160ca6d Duplicate the code paths for autocommands. 2016-01-24 23:02:40 +01:00
LemonBoy
2502080871 Change when the autocmds are sent.
As per #175 if a -botcmd is specified for a given channel without a
-bots parameter then the command is sent right after joining the
channel.
2016-01-14 23:54:42 +01:00
ailin-nemui
62cab9d662 Merge pull request #393 from ailin-nemui/moduleversion-perl
forward ABI to perl modules
2016-01-11 21:19:35 +01:00
LemonBoy
dbee606c60 Don't break the API.
Have a ignore_find_full method that is the one that all the new code
should be using and provide some working stubs for ignore_find and
ignore_find_noact.
2016-01-03 21:26:57 +01:00
LemonBoy
609f3ba6c2 Clean up the ignore_find API to make it more powerful.
This way we prevent the creation of duplicate ignores since the old code
skipped the ignore_find call when a pattern was specified.
It should also cover all the cases where the ignores would be wrongly
overwritten, such as the case outlined in #78.
2016-01-03 19:49:18 +01:00
ailin-nemui
ff8ccaf08b module check irssi version
Add explicit checks into every module to match the ABI version defined
in common.h
2015-12-10 00:52:33 +01:00
ailin-nemui
4dc2bab4b4 Merge pull request #371 from LemonBoy/rampage
Rewrite some faulty logic handling the saved channels. Fixes #340
2015-12-09 23:07:48 +01:00
dequis
96766b7f05 Remove all WIN32 ifdefs (unifdef -UWIN32)
Just use cygwin.

This looks like it wasn't enough to do anything useful, and I don't
think anyone cares about supporting win32 the hard way.
2015-12-09 15:20:59 -03:00
LemonBoy
1749a7a5ab Minor adjustments.
Use g_strcmp0 instead of strcmp.
Explicit checks added for the g_strcmp0 clauses.
2015-12-09 16:16:03 +01:00
LemonBoy
971417caa3 Rewrite some faulty logic handling the saved servers. 2015-12-09 16:02:37 +01:00
LemonBoy
60c501625b Better function naming 2015-12-09 15:43:31 +01:00
LemonBoy
750df38e8c Rewrite some faulty logic handling the saved channels.
Issue #340 brought to our attention the fact that under certain
circumstances irssi would go on a wild rampage and carelessly overwrite
some saved channel records in the configuration file.
This happened because the code didn't take into account the case where
the channel index in setupchannels wouldn't match the one in the
configuration; this actually happens when the user removes a chatnet
without removing the associated channels.
2015-12-09 00:34:39 +01:00
LemonBoy
8701cbc972 Let ignore_check do its work when server is NULL
A NULL-check has been added to the ignore_match_server macro, making the
function safe from a pointer perspective.
Fixes #193 in the meanwhile.
2015-11-22 17:20:00 +01:00
LemonBoy
3d9b9d473f Strip the trailing whitespace from /join commands.
Fixes #99 for great good.
2015-11-09 18:42:49 +01:00
LemonBoy
1006fee802 Add an option to strip trailing whitespace when parsing commands 2015-11-09 17:32:51 +01:00
ailin-nemui
6d6e672e8e Merge pull request #313 from isundil/master
Fix #45 Make it easy to delete default channels, servers and networks
2015-11-09 16:45:19 +01:00
ailin-nemui
0188c1fb5d Merge pull request #341 from dequis/strsplit-len-fix
Fix invalid reads in strsplit_len when splitting on spaces
2015-11-09 16:21:33 +01:00
dequis
b054ade4b9 strsplit_len: make it look more like the original version 2015-11-09 06:46:40 -03:00
dequis
8736c12fc9 strsplit_len: use strlen() directly instead of a remaining_len variable 2015-11-09 06:33:08 -03:00
dx
8d1f667100 Merge pull request #320 from irssi/ahf/add-setting-type-any
Fix warnings
2015-11-01 13:40:54 -03:00
dequis
ed28483e75 Fix invalid reads in strsplit_len when splitting on spaces
The symptom for this one is randomly getting lines split before the last
word, even if there's no need for splitting. Also, this function is only
reached if recode is on, and iconv failed (for example, due to an
incorrect source charset). Thanks to vague for finding this and
providing valgrind logs.

The loop that looks for spaces tried to read backwards from the end of
the current line, with the end being determined by len. Assuming
strsplit_len() with len=400, this meant accessing str[399] in the first
iteration. For strings that don't need splitting, this means an invalid
read always.

If that invalid read happens to hit garbage that has a space character,
(len - offset) points after the end of string, which isn't a problem for
g_strndup() since it stops at the first null, and no splitting happens.
If the garbage doesn't have any spaces, it splits by the last word.

This commit avoids that loop entirely if (remaining_len > len). It also
changes the way it iterates over the string to be much less confusing.
2015-10-23 05:12:04 -03:00
dequis
f540ec9de1 Fix /reconnect RECON-1 saying "Reconnection tag 1 not found"
Turns out it was fixing the wrong string, and trying to do
atoi("RECON-1") instead of atoi("1").

"/reconnect 1" worked, but "/reconnect RECON-1" gave that confusing
error message.
2015-10-08 00:06:17 -03:00
Alexander Færøy
685d8fe5b0
Add SETTING_TYPE_ANY and replace -1 with it. 2015-10-03 19:01:16 +02:00
LemonBoy
b68a30cdfe Include write-buffer.h in log-away.c
Silence a warning and make the world a better place.
2015-10-03 14:32:38 +02:00
dequis
ef55e0f653 Add missing null terminator to the g_build_path() varargs
Lemon broke it a few commits ago.
2015-10-02 13:48:23 -03:00
Geert Hauwaerts
9c5f6780b2 Merge pull request #316 from LemonBoy/fix_mem_leak
Fix a memory leak.
2015-10-02 09:39:10 -07:00
LemonBoy
db5ae4adce Flush the dirty buffer to disk
Given a big enough write_buffer_size and a long enough
write_buffer_timeout it might be possible to show the user an incomplete
or empty awaylog.

Patch by: Petteri Aimonen
2015-10-02 17:21:17 +02:00
LemonBoy
b545bc96a9 Fix a memory leak.
g_get_current_dir() returns a heap-allocated string.
2015-10-02 12:39:08 +02:00
isundil
ef1a09b87d Fix return value of server_setup_remove_chatnet 2015-10-01 22:53:34 +02:00
isundil
6ca7dc6847 Updated server removal
Removing network will also remove attached channels
2015-10-01 22:36:02 +02:00
isundil
2ad6bb1295 Fix #45 Make it easy to delete default channels, servers and networks
Removing network will now also remove all attached servers
2015-10-01 21:14:30 +02:00
Jari Matilainen
a2277e84bd Added functionality to create dir if dir specified in rawlog filename 2015-09-24 11:59:18 +02:00