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
ailin-nemui
7ab38f29ed
Merge pull request #333 from dequis/recon-tag-fix
...
Fix /reconnect RECON-1 saying "Reconnection tag 1 not found"
2015-10-08 09:18:04 +02: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
dequis
58a166484a
Add xterm's keypad enter, meta-O-M to "key return" bindings
...
From the 'kent' terminfo entry. Also applies to putty.
Fixes #327
2015-10-06 06:15:47 -03:00
ailin-nemui
79fa2fcb59
Merge pull request #318 from LemonBoy/fix-utf8-elements
...
Fix the display of utf8 sequences in the gui
2015-10-04 20:22:36 +02:00
LemonBoy
0140e7c6b2
Fix the indentation.
2015-10-04 20:23:51 +02:00
dx
15a40ea6d3
Merge pull request #314 from LemonBoy/sasl_session
...
Save the sasl state in the session
2015-10-03 22:15:17 -03:00
Alexander Færøy
2127fd362e
Add -Wall and -Werror as CFLAGS to make.
2015-10-03 19:07:08 +02:00
Alexander Færøy
5f35fbc57a
Remove check for >= 0 for unsigned unichar.
2015-10-03 19:01:16 +02:00
Alexander Færøy
685d8fe5b0
Add SETTING_TYPE_ANY and replace -1 with it.
2015-10-03 19:01:16 +02:00
Alexander Færøy
48375c3f90
Simplify Travis config.
2015-10-03 18:59:33 +02:00
Alexander Færøy
5e8523c037
Merge pull request #322 from LemonBoy/fix-warning-awaylog
...
Include write-buffer.h in log-away.c
2015-10-03 14:33:02 +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
Alexander Færøy
da3f2f0d01
Set HOST_NAME_MAX to 255, if it's undefined.
...
Thanks to Jilles and dx.
Fixes #309
2015-10-02 19:55:29 +02:00
Alexander Færøy
a66bb95d0e
Use silent rules.
2015-10-02 19:49:41 +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
Geert Hauwaerts
bd696a096e
Merge pull request #319 from LemonBoy/awaylog-flush
...
Flush the dirty buffer to disk
2015-10-02 09:33:03 -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
48ab298a67
Kill an unneeded declaration
2015-10-02 15:08:48 +02:00
LemonBoy
c7646dc58d
Even simpler logic
2015-10-02 15:07:59 +02:00
LemonBoy
c351c448b8
Rework the logic to avoid allocating memory
2015-10-02 15:02:43 +02:00
LemonBoy
2e860abd2b
Fix the display of utf8 sequences in the gui
...
term_addstr() had a long-standing fixme that suggested it didn't
take into account the string encoding when calculating the string
length.
The BIG5 code path is untested.
2015-10-02 14:44:35 +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
dx
c3e4664870
Merge pull request #294 from dequis/key-states-rescan-recursion-limit
...
Limit recursion depth of key/combo expansion in key_states_scan()
2015-10-02 07:22:48 -03:00
ailin-nemui
acbe2ecac2
Merge pull request #315 from LemonBoy/prevent_blank_usermode
...
Don't set the usermode field if blank
2015-10-02 11:48:11 +02:00
LemonBoy
cfff402fe6
Don't set the usermode field if blank
...
Fixes FS#919
2015-10-02 11:25:30 +02:00
LemonBoy
a475d57183
Save the sasl state in the session
...
This is seemingly required to have irssi re-authenticate after a
restart.
2015-10-02 10:52:13 +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
dx
8217147a80
Merge pull request #312 from Jellyfrog/patch-1
...
Switch to modern Travis CI infrastructure
2015-10-01 01:48:06 -03:00
Jellyfrog
00176dbff5
Switch to modern Travis CI infrastructure
...
Fixes #310
2015-09-29 18:51:22 +02:00
ailin-nemui
fb6375c6f9
Merge pull request #308 from vague666/sasl_in_network_list
...
Add sasl info to /network list output if available
2015-09-29 12:00:44 +02:00
Jari Matilainen
b04b5f0f1d
Make sure sasl settings are defined before printing them out
2015-09-29 11:44:11 +02:00
Jari Matilainen
cff536ab70
Add sasl info to /network list output if available
2015-09-29 10:39:49 +02:00
ailin-nemui
3e4926d87b
Merge pull request #307 from chi6rag/master
...
Remove Typo from Startup FAQs
2015-09-28 05:34:38 +02:00
Chirag Aggarwal
0f066aac11
Remove Typo from FAQs
2015-09-28 08:54:19 +05:30
dequis
7866d2bcd6
Handle empty bracketed pastes (or sequences of those)
...
Both cases were off-by-one mistakes erring on the side of being too
conservative. This fixes these two harmless issues:
- For a single empty paste, it required another keystroke before
processing it
- For a sequence of themcase, a single '~' was left in the input
2015-09-27 16:08:07 -03:00
dequis
c721d57688
Handle a paste start marker right after an end one (ignore both)
...
This actually workarounds a bug with the "st" terminal, for which i've
already submitted a patch, but irssi needs to be able to handle it
decently too.
2015-09-27 16:08:07 -03:00
dequis
7d062a313a
Create paste_bracketed_middle() function to handle small pastes
...
"Small" as in ending in the same sig_input() call where they started
2015-09-27 16:08:07 -03:00
dequis
83f9772e21
Fix some minor style issues
2015-09-27 16:08:07 -03:00
dequis
79987d87f3
Send last line of bracketed paste together with the rest
2015-09-27 16:08:07 -03:00
dequis
3b01198f03
paste_bracketed_end: Fix rest length calculation
2015-09-27 16:08:07 -03:00
dequis
52729ca3da
Save the part of the paste buffer after the bp_end marker for later
...
Also move relevant code to a paste_bracketed_end() function
2015-09-27 16:08:07 -03:00
dequis
9a6b2dedcc
Improve bracketed paste start/end detection
...
- Use a keybinding to detect the start of a bracketed paste
- Iterate over the paste buffer looking for the end marker
2015-09-27 16:08:07 -03:00
LemonBoy
6888fc5fc7
Get rid of the non-portable memmem
...
The sequences we're after are found at the beginning or at the end of the
buffer, there's no need to scan the whole thing.
2015-09-27 16:08:06 -03:00
LemonBoy
4764b102ff
Enable the bracketed paste mode on demand
2015-09-27 16:08:06 -03:00
LemonBoy
15dad291c7
Replace some hairy logic with g_array_remove_range
...
In the hope it'll do the same under the hood.
2015-09-27 16:08:06 -03:00
LemonBoy
f1eead7b4a
Toggles
2015-09-27 16:08:06 -03:00