Summary: | [PATCH] Make wildcard address matching/autocomplete a bit smarter by sorting results in a more human way. | ||
---|---|---|---|
Product: | Claws Mail (GTK 2) | Reporter: | Michael Gmelin <freebsd> |
Component: | UI/Compose Window | Assignee: | users |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P3 | ||
Version: | 3.10.1 | ||
Hardware: | PC | ||
OS: | FreeBSD | ||
Attachments: |
Description
Michael Gmelin
2014-06-17 02:40:32 UTC
First, I get a crash when I typed a two-letter combination ("mg") that matches two things in my AB: a group name, and the right part of one email address (after the @). The crash can be immediate or after a long while where CM is 'dead', see: #0 0x0000003355b3385f in __strlen_sse42 () from /lib64/libc.so.6 #1 0x0000000000454193 in weight_addr_match (addr=0xce2a50) at addr_compl.c:187 #2 0x00000000004542be in addr_comparison_func (a=0xb269f0, b=0xce2a50) at addr_compl.c:219 #3 0x000000335725f11f in ?? () from /lib64/libglib-2.0.so.0 #4 0x0000000000455192 in complete_address (str=0x2598430 "mg") at addr_compl.c:616 #5 0x0000000000456eb5 in address_completion_complete_address_in_entry (entry=0x13fd720, next=1) at addr_compl.c:1409 #6 0x0000000000456c5a in address_completion_entry_key_pressed (entry=0x13fd720, ev=0x1438d50, data=0xfeefaa) at addr_compl.c:1351 On a CentOS6 64-bit. And I forgot to add that I definitely agree with the principles behind this patch. It's on the hacky side, it works for me as I don't use group names. I'll refine it later tonight or in the next few days and do some more thorough testing. Created attachment 1409 [details] Additional patch (to be applied after the first one) that fixes the crash on group match Fixes the crash and slightly improves weighting in case both name and address match. To be applied *after* applying patch attachment 1408 [details] With this second patch applied I cannot reproduce the issue anymore. Thanks Michael, cool patch - much better than the hidden preference :) I think there's at least three of us who wanted to do it, but you beat us to it. Applied with a minor extra check! Hi Colin, The second extra check is important, but it seems to break the logic though by using the wrong operator (didn't test it yet): if (strlen(match) < strlen(g_completion_prefix) && *(match + strlen(g_completion_prefix)) == '@') a_weight--; I think this should be: if (strlen(match) > strlen(g_completion_prefix) .. since strlen(match) is always >= strlen(g_completion_prefix) and never < strlen(g_completion_prefix). e.g. search for mg in mg@example.org => strlen(match) == 15 => strlen(g_completion_prefix) == 2 Changes related to this bug have been committed. Please check latest Git and update the bug accordingly. You can also get the patch from: http://git.claws-mail.org/ ++ ChangeLog 2014-06-17 22:30:02.662353761 +0200 http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=0af6a07abeb198f5c70962847d6ea035183410c6 Merge: feca001 93ffffa Author: Colin Leroy <colin@colino.net> Date: Tue Jun 17 22:30:02 2014 +0200 Merge branch 'master' of file:///home/git/claws http://git.claws-mail.org/?p=claws.git;a=commitdiff;h=93ffffab990f8e21541ac13aec7e58a1b44b27b8 Author: Colin Leroy <colin@colino.net> Date: Tue Jun 17 22:29:08 2014 +0200 Fix obvious mistake, thanks Michael (bug #3215) |