Problem: Defining a global gettimeofday() function causes conflicts if
gettimeofday() is already defined.
Solution: Revert globalized gettimeofday() function (Hirohito Higashi).
fixes: #18162fixes: #18161fixes: #18170closes: #18173
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: socket server code can be improved
Solution: Refactor code, get rid of gettimeofday() and use ELAPSED_
macros (Foxe Chen)
closes: #18147
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: The code inside an ifdef was indented incorrectly.
Solution: Adjusted the indentation by one level (glepnir).
closes: #18174
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Some functions need to be re-ordered
Solution: Re-order and move functions around favoring mch_*() functions
inside os_*.c files, Change scope of dos_expandpath() to
global instead of static (Hirohito Higashi)
The following fixes and tweaks have been made:
- Moved the definition of mch_expandpath() from filepath.c to os_win32.c
in MS-Windows builds (essentially, the mch_~() function should be
defined in os_~.c.)
- In accordance with the above, the scope of dos_expandpath() has been
changed from static to global.
- Other miscellaneous changes.
closes: #18176
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: fvwm2m4 files are no longer recognized
(after 9.1.1687).
Solution: Add a special case in m4 filetype detection (zeertzjq).
closes: #18146
Co-authored-by: Damien Lejay <damien@lejay.be>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: screen not redrawn properly on t_RB response (after v9.1.1703)
Solution: Call redraw_asap() if necessary (Julio B)
closes: #18149
Signed-off-by: Julio B <julio.bacel@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Missing type cast in clipboard.c
(Yegappan Lakshmanan, after v9.1.1704)
Solution: Add back the type cast (Foxe Chen)
closes: #18148
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: various tests can be improved
Solution: Use string interpolation to concatenate strings in
test_winfixbuf, check for specific errors in assert_fails()
(Yegappan Lakshmanan)
closes: #18151
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: Compile error when building with if_ruby
(Christian Robinson, after v9.1.1704)
Solution: Do not define gettimeofday() if ruby interface is compiled in
(Foxe Chen).
fixes: #18143closes: #18144
Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: time.h include is available on all platforms
Solution: Remove ifdef guards and simply include it in all source files,
get rid of double include in spellfile.c (Damien Lejay).
closes: #18075
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: failure on CI with GUI and ASAN in test_edit.res
(Hirohito Higashi)
Solution: Disable the test for that specific situation in CI, close
swapfiles
fixes: #18070
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: a pattern that involves a backref on a different line does not
match when 'ignorecase' is set (QiWei, after v9.1.0645)
Solution: Use MB_STRNICMP when ignorecase is set, fix tests to close
swapfiles
related: #14756fixes: #17470closes: #18104
Signed-off-by: author
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Fuzzy completion disabled for 'findfunc' and customlist
Solution: Remove those cases from cmdline_fuzzy_completion_supported()
because it is supported (Maxim Kim).
fixes: #18117closes: #18122
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: no test for aclocal.m4
(after v9.1.1693)
Solution: Add a test that aclocal.m4 is detected as config filetype
related: #18065
Signed-off-by: Christian Brabandt <cb@256bit.org>
There exists a real nl.po file, no need to use a dummy po file anymore.
See also the following commits: 84f7235, 8d61617, 02938a9closes: #18127
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: getwininfo() has logic for getting the tabnr of a local popup
window, but due to only breaking from the inner loop, tp is
eventually set to NULL, so tabnr is always 0.
Solution: Break out of both loops, continue to use 0 for global popup
windows (Sean Dewar).
closes: #18111
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Need more Vim script specific tests
Solution: Add more tests (Yegappan Lakshmanan).
closes: #18118
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: test_filetype fails in shadow dir
(after v9.1.9.1.1687)
Solution: Use a custom test that does not rely on configure.ac
being existing in the upper directory tree.
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: global_functions are not constant
Solution: Place global_functions[] in read-only memory (Damien Lejay).
Mark global_functions[] as `static const`. The table is never modified
at runtime, so keeping it in writable `.data` has no benefit.
Only a local pointer in func_check_arg_types() needed adjusting to
`const`. No functional changes.
closes: #18121
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: over-allocation in ga_concat_strings()
Solution: Fix ga_concat_strings() and only allocate n-1 separator length
bytes (Damien Lejay).
ga_concat_strings() was adding the separator length for every item,
including the last one. Only (n - 1) separators are actually used.
This caused harmless but unnecessary overallocation.
closes: #18112
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: CmdlineChanged not triggered by <Del>
Solution: Use STRCMP() instead of STRNCMP()
(Shougo Matsushita)
closes: #18101
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: potential buffer overrun in bufwrite.c
Solution: Use a temporary variable (John Marriott)
In my Windows 11 Pro 64-bit build MAXPATHL is 1024 and IOSIZE is 1025.
In my Archlinux Linux 64-bit build MAXPATHL is 4096 and IOSIZE is 1025.
In funuction buf_write():
There is a check (line 713) that makes sure the length of fname is less
than MAXPATHL. There is a call to STRCPY() (line 1208) which copies the
string at fname into IObuff (which has size IOSIZE). For Unix builds
fname is set to sfname which may or may not be shorter. However, if
sfname is NULL sfname is set to fname.
Therefore, in builds where MAXPATHL > IOSIZE (eg in my linux build), it
is theoretically possible for the STRCPY() call to exceed the bounds of
IObuff.
This PR addresses this by copying fname into a local variable that has
the same maximum size as fname.
In addition:
Given that the filename is unconditionally overwritten in the for loop,
only copy the directory portion of fname. Move variable i closer to
where it is used.
closes: #18095
Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: filetype: autoconf filetype not always correct
Solution: Detect aclocal.m4 as config filetype, detect configure.ac as
config filetype, fall back to POSIX m4 (Damien Lejay).
closes: #18065
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: if_ruby: unknown pragma when not using gcc
Solution: only use GCC pragma, when using GCC
(Cthulhux)
fixes: #18109closes: #18110
Signed-off-by: Cthulhux <github@tuxproject.de>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: min()/max() does not handle float data types
(ubaldot)
Solution: Extend min() and max() to every comparable type
(LemonBoy)
Re-use the logic used for plain old comparison operators, this way we
gain support for float values and unify the logic handling the
comparisons.
fixes: #18052
closes: 18055
Signed-off-by: LemonBoy <thatlemon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: Test_wildtrigger_update_screen() creates an unused
mapping (after 9.1.1621).
Solution: Remove the mapping. Also use blank lines more consistently in
test_cmdline.vim screendump tests (zeertzjq).
closes: #18096
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: tests: no test for actually moving cursor when menu is not
open with 'autocompletedelay'.
Solution: Use <Up> first in the test. Also remove two unnecessary <Esc>s
in completion timeout test (zeertzjq).
closes: #18097
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: possible buffer-under run in if_cscope
cs_pathcomponents() (Murali Aniruddhan)
Solution: Fix the loop and do not decrement the pointer twice.
closes: #18091
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: Amiga: cannot handle large undo files
Solution: Remove the existing restriction as it was only valid for
classic Amiga (Damien Lejay).
It seems that this block was only relevant for classic AmigaOS (< 32K
alloc limit). And it seems to no longer apply: AmigaOS 4.0 switched to
a slab allocator memory system.
closes: #18072
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: wrong ifdef in message.c
Solution: change it to #ifndef MSWIN (Damien Lejay)
The extra newline on screen switch is needed for all TTY/termcap
backends (Unix, VMS, others).
Only Windows uses a different console API.
Better use #ifndef MSWIN to express the real intent.
closes: #18076
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: MS-Windows: Makefiles can be refactored
Solution: Refactor using a common tools.mak, make some style changes
(RestorerZ).
closes: #18060
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>