Sebastian Stark [Sun, 26 May 2019 08:04:58 +0000 (10:04 +0200)]
make OP_HALF_{UP,DOWN} behave symmetric.
- the calculation of number of lines to scroll up/down should not
depend on whether the number of rows in the pager/index/terminal is
odd or even.
- this patch will make the behaviour symmetric such that in both cases
(even/odd number of rows) scrolling up and down by half a page (or the
other way round) will get you back to the exact same line as before.
Richard Russon [Sun, 26 May 2019 16:20:09 +0000 (17:20 +0100)]
merge: improve string tests
* test: improve test_mutt_str_adjust()
* test: improve test_mutt_str_append_item()
* test: improve test_mutt_str_asprintf()
* test: improve test_mutt_str_dequote_comment()
* test: improve test_mutt_str_find_word()
* test: improve test_mutt_str_getenv()
* test: improve test_mutt_str_inline_replace()
* test: improve test_mutt_str_is_ascii()
* test: improve test_mutt_str_is_email_wsp()
* test: improve test_mutt_str_lws_len()
* test: improve test_mutt_str_lws_rlen()
* test: improve test_mutt_str_next_word()
* test: improve test_mutt_str_pretty_size()
* test: improve test_mutt_str_remall_strcasestr()
* test: improve test_mutt_str_remove_trailing_ws()
* test: improve test_mutt_str_replace()
* test: improve test_mutt_str_rstrnstr()
* test: improve test_mutt_str_skip_email_wsp()
* test: improve test_mutt_str_skip_whitespace()
* test: improve test_mutt_str_split()
* test: improve test_mutt_str_startswith()
* test: improve test_mutt_str_strcasecmp()
* test: improve test_mutt_str_strcasestr()
* test: improve test_mutt_str_strcat()
* test: improve test_mutt_str_strchrnul()
* test: improve test_mutt_str_strcmp()
* test: improve test_mutt_str_strcoll()
* test: improve test_mutt_str_strdup()
* test: improve test_mutt_str_strfcpy()
* test: improve test_mutt_str_stristr()
* test: improve test_mutt_str_strlen()
* test: improve test_mutt_str_strlower()
* test: improve test_mutt_str_strncasecmp()
* test: improve test_mutt_str_strncat()
* test: improve test_mutt_str_strncmp()
* test: improve test_mutt_str_strnfcpy()
* test: improve test_mutt_str_substr_cpy()
* test: improve test_mutt_str_substr_dup()
* test: improve test_mutt_str_word_casecmp()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_word_casecmp()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_substr_dup()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_substr_cpy()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strnfcpy()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strncmp()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strncat()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strncasecmp()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strlower()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strlen()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_stristr()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strfcpy()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strdup()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strcoll()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strcmp()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strchrnul()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strcat()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strcasestr()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_strcasecmp()
Richard Russon [Sun, 26 May 2019 15:02:24 +0000 (16:02 +0100)]
test: improve test_mutt_str_startswith()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_split()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_skip_whitespace()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_skip_email_wsp()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_rstrnstr()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_replace()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_remove_trailing_ws()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_remall_strcasestr()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_pretty_size()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_next_word()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_lws_rlen()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_lws_len()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_is_email_wsp()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_is_ascii()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_inline_replace()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_getenv()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_find_word()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_dequote_comment()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_asprintf()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_append_item()
Richard Russon [Sun, 26 May 2019 15:02:23 +0000 (16:02 +0100)]
test: improve test_mutt_str_adjust()
Richard Russon [Sun, 26 May 2019 16:17:18 +0000 (17:17 +0100)]
merge: improve Buffer tests
* test: improve test_mutt_buffer_add_printf()
* test: improve test_mutt_buffer_addch()
* test: improve test_mutt_buffer_addstr()
* test: improve test_mutt_buffer_addstr_n()
* test: improve test_mutt_buffer_alloc()
* test: improve test_mutt_buffer_concat_path()
* test: improve test_mutt_buffer_fix_dptr()
* test: improve test_mutt_buffer_free()
* test: improve test_mutt_buffer_from()
* test: improve test_mutt_buffer_increase_size()
* test: improve test_mutt_buffer_init()
* test: improve test_mutt_buffer_is_empty()
* test: improve test_mutt_buffer_len()
* test: improve test_mutt_buffer_new()
* test: improve test_mutt_buffer_printf()
* test: improve test_mutt_buffer_reset()
* test: improve test_mutt_buffer_strcpy()
* test: improve test_mutt_buffer_strcpy_n()
* reorganise buffer header
Richard Russon [Sat, 25 May 2019 00:58:26 +0000 (01:58 +0100)]
reorganise buffer header
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_strcpy_n()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_strcpy()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_reset()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_printf()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_new()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_len()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_is_empty()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_init()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_increase_size()
Richard Russon [Sat, 25 May 2019 15:08:51 +0000 (16:08 +0100)]
coverity
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_from()
Richard Russon [Fri, 24 May 2019 14:36:15 +0000 (15:36 +0100)]
move the null logger into libmutt
This logger is used by the test code (for quietness).
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_free()
Richard Russon [Fri, 24 May 2019 14:05:30 +0000 (15:05 +0100)]
remove unnecessary test in mutt_mem_calloc()
There's no point in making a calculation.
Either calloc() succeeds, or it doesn't.
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_fix_dptr()
Richard Russon [Fri, 24 May 2019 13:47:19 +0000 (14:47 +0100)]
fix idn macro
gcc9 isn't happy with pre-proc conditionals inside a macro.
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_concat_path()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_alloc()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_addstr_n()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_addstr()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_addch()
Richard Russon [Fri, 24 May 2019 22:24:04 +0000 (23:24 +0100)]
test: improve test_mutt_buffer_add_printf()
Pietro Cerutti [Fri, 24 May 2019 13:17:24 +0000 (13:17 +0000)]
Fix Coverity CID 198652
Pietro Cerutti [Fri, 24 May 2019 13:00:21 +0000 (13:00 +0000)]
Fix Coverity CID 198656 / 198649
Richard Russon [Thu, 23 May 2019 16:17:11 +0000 (17:17 +0100)]
fix: improve function checks
Austin Ray [Wed, 22 May 2019 20:40:03 +0000 (16:40 -0400)]
fix: stop CUR_EMAIL underflow in entire-thread
entire-thread will underflow CUR_EMAIL macro if no mailbox is
configured. To prevent this, call 'prereq()' before any other logic.
'prereq()' will ensure we have a mailbox thus preventing the underflow.
flatcap deserves credit for identifying the solution.
Fixes: #1719
Pietro Cerutti [Fri, 24 May 2019 07:14:03 +0000 (07:14 +0000)]
Pass the test for mutt_addrlist_to_intl when building wihtout idn
Richard Russon [Thu, 23 May 2019 14:14:49 +0000 (15:14 +0100)]
merge: update transations
* Updated Catalan translation.
* sync translations
Richard Russon [Thu, 23 May 2019 14:14:39 +0000 (15:14 +0100)]
sync translations
Ivan Vilata i Balaguer [Wed, 15 May 2019 16:09:25 +0000 (09:09 -0700)]
Updated Catalan translation.
Co-authored-by: Richard Russon <rich@flatcap.org>
Richard Russon [Wed, 22 May 2019 13:30:33 +0000 (14:30 +0100)]
coverage: exclude 3rd party files
We don't care about system header files.
Richard Russon [Thu, 23 May 2019 11:33:38 +0000 (12:33 +0100)]
merge: Convert Address to use TAILQ
* Define an AddressList structure using TAILQ
* Add functions to convert to/from Address/AddressList
* Use AddressList in mutt_addrlist_dedupe
* Use AddressList in mutt_addr_parse_list
* Const'ify parameter to mutt_addr_copy
* Implement mutt_addresslist_new
* Use AddressList in mutt_addr_copy_list
* Use AddressList in mutt_addr_free, implement mutt_addresslist_free_one
* Use AddressList in mutt_addr_remove_from_list
* Use AddressList in mutt_addr_qualify
* Use AddressList in mutt_addr_append
* Use AddressList in mutt_addr_cmp_strict
* Use AddressList in mutt_addr_has_recips
* Use AddressList in mutt_addr_search
* Use AddressList in mutt_addr_remove_xrefs
* Tidy Address free'ing functions
* Use AddressList in mutt_addr_write
* Use AddressList in mutt_addrlist_to_intl and mutt_addrlist_to_local
* Convert mutt_addr_remove_from_list and mutt_addr_remove_xrefs API to AddressList
* Convert Alias to use AddressList
* Convert Envelope addresses to AddressList
* Fix variadic function
* Fix recursive alias lookup
* Cleanup Address API: mutt_addr_cmp_strict -> mutt_addresslist_equal
* Cleanup Address API: parse and free
* Cleanup Address API: mutt_addresslist_qualify
* Cleanup Address API: mutt_addr_write
* Fix and refactor mutt_is_list_recipient and mutt_is_subscribed_list_recipient
* Fix match_user
* Cleanup Address API: unexpose mutt_addr_is_(intl|local)
* Cleanup Address API: unexpose mutt_addr_mbox_to_udomain
* Cleanup Address API: mutt_addr_remove_from_list -> mutt_addresslist_remove
* Cleanup Address API: mutt_addr_remove_xrefs -> mutt_addresslist_remove_xrefs
* Cleanup Address API: unexpose mutt_addr_set_(intl|local)
* Cleanup Address API: mutt_addrlist_dedupe -> mutt_addresslist_dedupe
* Cleanup Address API: mutt_addrlist_to_(intl|local) -> mutt_addresslist_to_(intl|local)
* Remove "next" pointer from struct Address: conversion to TAILQ is complete
* Merge AddressNode into Address
* Rename mutt_addresslist_* to mutt_addrlist_*
* Provide mutt_addrlist_append and mutt_addrlist_prepend
* doxy: fix comments
* test: update basic address tests
* remove 'mutt_' from static functions
* Add tests for mutt_addr_cmp
* Add tests for mutt_addr_cat, explain what it does does in the Doxygen block
* Add tests for mutt_addr_copy
* Add tests for mutt_addr_free
* Add tests for mutt_addr_valid_msgid
* Add test for mutt_addrlist_append and mutt_addrlist_prepend
* Add tests for mutt_addrlist_copy
* Add test for mutt_addrlist_dedupe, fix mutt_addrlist_parse
* Run clang-format over test/address
* Add tests for mutt_addrlist_equal
* Add tests for mutt_addrlist_free_all
* Add tests for mutt_addrlist_free_one
* Add tests for mutt_addrlist_free
* Boolify uses of Address' group
* tidy code
* Revert queue.h formatting
* Rename mutt_addrlist_has_recips to mutt_addrlist_count_recips and add tests
* Kill duplicate copyright line
* Rename mutt_addrlist_free_all into mutt_addrlist_clear, remove freeing functions
* Add tests for mutt_addrlist_count_recips
* Add tests for mutt_addrlist_parse + slight refactor and fix return value
* Slightly refactor mutt_addrlist_parse2
* Avoid leak in the test for mutt_addrlist_parse
* Add tests for mutt_addrlist_parse2
* Add tests for mutt_addrlist_qualify
* Sort address functions by name
* Add helper to create and populate an Address, avoid leaks in tests
* Simplify mutt_default_from
* Add tests formutt_addrlist_remove_xrefs
* Add tests for mutt_addrlist_remove
* Add (basic) tests for mutt_addrlist_to_(intl|local)
* Add tests for mutt_addrlist_write + make it more readable
* Fix test for mutt_addrlist_write and avoid leak
* Add mutt_addr_to_local
* Test addresses with comments in mutt_addrlist_parse
* Run clang-format over test/address
Pietro Cerutti [Wed, 22 May 2019 14:12:52 +0000 (14:12 +0000)]
Run clang-format over test/address
Pietro Cerutti [Wed, 22 May 2019 14:11:31 +0000 (14:11 +0000)]
Test addresses with comments in mutt_addrlist_parse
Pietro Cerutti [Wed, 22 May 2019 12:01:41 +0000 (12:01 +0000)]
Add mutt_addr_to_local
Pietro Cerutti [Wed, 22 May 2019 11:15:25 +0000 (11:15 +0000)]
Fix test for mutt_addrlist_write and avoid leak
Pietro Cerutti [Wed, 22 May 2019 10:09:00 +0000 (10:09 +0000)]
Add tests for mutt_addrlist_write + make it more readable
Pietro Cerutti [Wed, 22 May 2019 09:00:42 +0000 (09:00 +0000)]
Add (basic) tests for mutt_addrlist_to_(intl|local)
Pietro Cerutti [Tue, 21 May 2019 13:01:25 +0000 (13:01 +0000)]
Add tests for mutt_addrlist_remove
Pietro Cerutti [Tue, 21 May 2019 12:53:51 +0000 (12:53 +0000)]
Add tests formutt_addrlist_remove_xrefs
Pietro Cerutti [Mon, 20 May 2019 16:11:57 +0000 (16:11 +0000)]
Simplify mutt_default_from
Pietro Cerutti [Mon, 20 May 2019 16:10:12 +0000 (16:10 +0000)]
Add helper to create and populate an Address, avoid leaks in tests
Pietro Cerutti [Mon, 20 May 2019 15:19:25 +0000 (15:19 +0000)]
Sort address functions by name
Pietro Cerutti [Mon, 20 May 2019 11:44:41 +0000 (11:44 +0000)]
Add tests for mutt_addrlist_qualify
Pietro Cerutti [Mon, 20 May 2019 11:37:07 +0000 (11:37 +0000)]
Add tests for mutt_addrlist_parse2
Pietro Cerutti [Mon, 20 May 2019 11:36:53 +0000 (11:36 +0000)]
Avoid leak in the test for mutt_addrlist_parse
Pietro Cerutti [Mon, 20 May 2019 11:36:22 +0000 (11:36 +0000)]
Slightly refactor mutt_addrlist_parse2
Pietro Cerutti [Mon, 20 May 2019 11:20:50 +0000 (11:20 +0000)]
Add tests for mutt_addrlist_parse + slight refactor and fix return value
Pietro Cerutti [Mon, 20 May 2019 10:45:51 +0000 (10:45 +0000)]
Add tests for mutt_addrlist_count_recips
Pietro Cerutti [Sun, 19 May 2019 12:47:18 +0000 (12:47 +0000)]
Rename mutt_addrlist_free_all into mutt_addrlist_clear, remove freeing functions
No facilities are provided for the heap allocation and freeing of
AddressLists. The suggested usage is to to have AddressLists as
variables on the stack.
Pietro Cerutti [Sun, 19 May 2019 11:20:25 +0000 (11:20 +0000)]
Kill duplicate copyright line
Pietro Cerutti [Sun, 19 May 2019 11:18:53 +0000 (11:18 +0000)]
Rename mutt_addrlist_has_recips to mutt_addrlist_count_recips and add tests
Richard Russon [Sun, 19 May 2019 10:44:03 +0000 (11:44 +0100)]
Revert queue.h formatting
Richard Russon [Sun, 19 May 2019 10:42:33 +0000 (11:42 +0100)]
tidy code
- NULL pointers
- variable case
- rename function
- sprinkle credit
Pietro Cerutti [Sun, 19 May 2019 09:29:11 +0000 (09:29 +0000)]
Boolify uses of Address' group
Pietro Cerutti [Sun, 19 May 2019 09:06:15 +0000 (09:06 +0000)]
Add tests for mutt_addrlist_free
Pietro Cerutti [Sun, 19 May 2019 08:53:25 +0000 (08:53 +0000)]
Add tests for mutt_addrlist_free_one