summaryrefslogtreecommitdiff
path: root/src/core/misc.c
AgeCommit message (Collapse)Author
2014-10-19Try to split long lines on spacesSebastian Thorarensen
Try to split long lines on spaces to avoid words being splitted. This can be turned off with the option `split_line_on_space'. The code assumes that the terminal encoding has ASCII spaces.
2014-07-07Fix Clang warningsAlexander Færøy
This patch fixes a few warnings emitted by clang by removing the initialization of the list by itself.
2014-07-06Fix minor coding style issues in message splittingSebastian Thorarensen
2014-07-06Properly split long IRC messagesSebastian Thorarensen
This commit adds handling of long IRC messages to the core. In contrast to the `splitlong.pl' plugin, multi-byte encoded and recoded messages are properly split. To allow for this, a new function has been added to the server struct: `split_message'. `split_message' returns a string array with the message splitted to substrings of a length that the server can handle. If a protocol module doesn't have any limit, it can simply return a singleton array with a copy of the message. The `MSG' chat command now calls `split_message' before `send_message', and emits `message own_public' / `message own_private' with each substring, so that the string splitting will be visible in the UI. `split_message' in the IRC module uses `recode_split' which in turn uses iconv to properly split multi-byte encoded (and recoded) messages.
2014-06-10Replace deprecated g_str[n]casecmp with g_ascii_str[n]cmp.David Hill
2010-11-17Do not go beyond the end of the string when processing an octal escape.Jilles Tjoelker
This code is used, for example, when /set expand_escapes on. I can't reproduce crashes but I can reproduce garbage if I type a\1. bug #775 git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5195 dbcabf3a-b0e7-0310-adc4-f8d773084564
2010-04-03deprecated glib strup/down fixes from exg.Alexander Færøy
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5138 dbcabf3a-b0e7-0310-adc4-f8d773084564
2009-04-03Make the time duration parser stricter.Jilles Tjoelker
This makes /set server_reconnect_time = 10min fail instead of setting the time to 0. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@5057 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-04-25Refactor code to create a watcher for an fd into a function.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4813 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-29Remove unneeded includes.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4784 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-28Make strstr_full_case internal.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4778 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-09Use g_ascii_str{,n}casecmp for case insensitive comparison withEmanuele Giaquinta
ascii only strings. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4739 dbcabf3a-b0e7-0310-adc4-f8d773084564
2008-03-03Rename some variables.Emanuele Giaquinta
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4718 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Oops. Update address correctly now.Wouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4490 dbcabf3a-b0e7-0310-adc4-f8d773084564
2007-05-08Update FSF addressWouter Coekaerts
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4489 dbcabf3a-b0e7-0310-adc4-f8d773084564
2005-09-10Make parse_time_interval recognize negative times. Patch by Danijel Tasov ↵Wouter Coekaerts
and Elmar Hoffmann (Bug 23) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3990 dbcabf3a-b0e7-0310-adc4-f8d773084564
2004-11-04Fixed bug with time settings where hours actually returned 60*hoursValentin Batz
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3679 dbcabf3a-b0e7-0310-adc4-f8d773084564
2004-03-23added strocpy()Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3238 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-11-16parse_time_interval: x days were actually returned as hours. weeks wereTimo Sirainen
returned as hours*7.. which also means I calculated the max. return value of over 1 year wrong. It's actually 24 days, but it's hopefully enough. Removed "weeks" unit to discourage usage of large values.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3143 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-11-16Time parsing: allow omitting time unit without warning for backwardsTimo Sirainen
compatibility. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3139 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-01-31Removed execute(), not used.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3107 dbcabf3a-b0e7-0310-adc4-f8d773084564
2003-01-08parse_time_interval() fallbacked to milliseconds, not seconds. some codeTimo Sirainen
cleanups. patch by Peder git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3094 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-12-28Added time, size and level setting types. Breaks some settings - I'll addTimo Sirainen
automatic converter to these settings later. Meanwhile you CVS users can fix your config files yourself :) Time settings allow using "days", "hours", "minutes", "seconds" and "milliseconds" or several of their abbreviations. For example "5d 4h 5msecs". Size settings allow using "gbytes", "mbytes", "kbytes" and "bytes" or their abbrevations. For example "5MB". Level settings are currently handled pretty much the way they were before. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3080 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-12-28fix compiler warningsTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3077 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-11-21Irssi now uses 64bit file offets if it's only supported by system. Also didTimo Sirainen
a few changes to DCC so that it should be possible to send >4GB files. DCC protocol uses 32bit "n bytes transferred" notifications, so I had to bend the protocol a bit to allow 64bit files by truncating the value to lowest 32bits. I'm not sure how other clients handle those notifications, but irssi uses it only to figure out when the DCC SEND transfer is complete, so it's quite safe to assume that if we've managed to write() all the bytes and we receive the last 32bit of file size, it means the total file size instead of the total - (n+1)*4GB. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3018 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-10-19Handle correctly g_get_home_dir() returning NULL, assume it's the currentTimo Sirainen
directory then. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2968 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-07-16'\' characters in nicks were skipped when sending messages in queries.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2867 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-02-12missed isxdigit() -> i_isxdigit() changeTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2432 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-27toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in someTimo Sirainen
systems, use our own is_...() functions now instead. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
2002-01-04moved the two { chars inside #ifdef #else #endif to one { outside it, so it ↵Timo Sirainen
won't confuse some parsers. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2295 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-08-08Added function expand_escapes() which handles now escaping /EVAL and inputTimo Sirainen
line if /SET expand_escapes is set. Supported escapes are \t, \r, \n, \e (ESC), \x (HEX, \x1b), \c (CTRL char, \cA), \000 (octal, \033) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1727 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-06-11get_max_column_count() didn't work properly if items had wider items thanTimo Sirainen
max_width. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1551 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-05-21get_max_column_count() didn't return correct value in save_column_widthsTimo Sirainen
when it returned only one column. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1510 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-03-03Make sure there's always at least one column even if there's itemsTimo Sirainen
wider than max. width allows. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1320 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-03-03Added strstr_full() and strstr_full_case()Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1309 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-02-10/SET names_max_columns, /SET names_max_width: Limit width of /NAMES list.Timo Sirainen
Forced max. 6 columns limit to /HELP git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1199 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-02-02get_max_column_count(), columns_sort_list(): fixed to work properlyTimo Sirainen
with empty list git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1176 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-28get_max_column_count() didn't work properly when there was only one itemTimo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1166 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-28get_max_column_count(): we didn't handle correctly a situation whereTimo Sirainen
last column of the list was empty git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1165 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-28get_max_column_count(), columns_sort_list(): helper functions forTimo Sirainen
printing column lists git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1160 dbcabf3a-b0e7-0310-adc4-f8d773084564
2001-01-14Added my_asctime()Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1114 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-12-04Use GIOChannel instead of sockets directly. Helps porting to win32 :)Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@962 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-30added g_timeval_cmp()Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@904 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-30stristr() and stristr_full() didn't work correctly with empty needleTimo Sirainen
argument. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@898 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-25mkpath() crashed with paths that didn't start with /Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@867 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-23s/enum GInputCondition/int/ - enums aren't supposed to orred together iTimo Sirainen
think.. at least MIPSpro gave warnings about it and it also feels wrong :) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@865 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-23several fixes to make irssi compile without warnings with MIPSproTimo Sirainen
also fixed ctcp_queue_clean() - it might have crashed sometimes.. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@859 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-11-07Updated stristr() and stristr_full() to be a bit faster.Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@813 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-10-26Some fixes for compiling with Win32 :)Timo Sirainen
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@783 dbcabf3a-b0e7-0310-adc4-f8d773084564
2000-10-13match_wildcards() failed if there was * at the end of the mask butTimo Sirainen
otherwise data matched (str* vs. str) git-svn-id: http://svn.irssi.org/repos/irssi/trunk@733 dbcabf3a-b0e7-0310-adc4-f8d773084564