0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

467 Commits

Author SHA1 Message Date
Keith Thompson
184f71cc68
patch 9.1.0006: is*() and to*() function may be unsafe
Problem:  is*() and to*() function may be unsafe
Solution: Add SAFE_* macros and start using those instead
          (Keith Thompson)

Use SAFE_() macros for is*() and to*() functions

The standard is*() and to*() functions declared in <ctype.h> have
undefined behavior for negative arguments other than EOF.  If plain char
is signed, passing an unchecked value from argv for from user input
to one of these functions has undefined behavior.

Solution: Add SAFE_*() macros that cast the argument to unsigned char.

Most implementations behave sanely for negative arguments, and most
character values in practice are non-negative, but it's still best
to avoid undefined behavior.

The change from #13347 has been omitted, as this has already been
separately fixed in commit ac709e2fc0db6d31abb7da96f743c40956b60c3a
(v9.0.2054)

fixes: #13332
closes: #13347

Signed-off-by: Keith Thompson <Keith.S.Thompson@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-04 21:19:04 +01:00
Christian Brabandt
5a679b2263
patch 9.0.2034: don't try to copy SMACK attribute, when none exist
Problem:  don't try to copy SMACK attribute, when none exist
Solution: return early if SMACK extended attributes do not exist or
          if they are not supported

closes: #1711
closes: #13348

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-16 10:17:13 +02:00
Gene C
993b17569b
patch 9.0.1975: xattr: permission-denied errors on write
Problem:  xattr: permission-denied errors on write
Solution: ignore those errors

closes: #13246

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Gene C <arch@sapience.com>
2023-10-02 22:44:12 +02:00
zeertzjq
7ece036d72
patch 9.0.1967: xattr errors not translated
Problem:  xattr errors not translated
Solution: mark for translation, consistently capitalize
          first letter.

closes: #13236

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-10-01 09:07:14 +02:00
Christian Brabandt
a4dfbfed89
patch 9.0.1964: xattr support fails to build on MacOS X
Problem:  xattr support fails to build on MacOS X
Solution: Disable xattr support for MacOS X

MacOS X uses the same headers and functions sys/xattr.h but the function
signatures for xattr support are much different, so building fails.

So let's for now disable xattr support there.

closes: #13230
closes: #13232

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-30 18:51:36 +02:00
zeertzjq
6de4e58cf2
patch 9.0.1963: Configure script may not detect xattr
Problem:  Configure script may not detect xattr correctly
Solution: include sys/xattr instead of attr/xattr,
          make Test_write_with_xattr_support() test
          xattr feature correctly

This also applies to the Smack security feature, so change the include
and configure script for it as well.

closes: #13229

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-30 14:22:07 +02:00
Christian Brabandt
e085dfda5d
patch 9.0.1962: No support for writing extended attributes
Problem:  No support for writing extended attributes
Solution: Add extended attribute support for linux

It's been a long standing issue, that if you write a file with extended
attributes and backupcopy is set to no, the file will loose the extended
attributes.

So this patch adds support for retrieving the extended attributes and
copying it to the new file. It currently only works on linux, mainly
because I don't know the different APIs for other systems (BSD, MacOSX and
Solaris).  On linux, this should be supported since Kernel 2.4 or
something, so this should be pretty safe to use now.

Enable the extended attribute support with normal builds.

I also added it explicitly to the :version output as well as make it
able to check using `:echo has("xattr")`, to have users easily check
that this is available.

In contrast to the similar support for SELINUX and SMACK support (which
also internally uses extended attributes), I have made this a FEAT_XATTR
define, instead of the similar HAVE_XATTR.

Add a test and change CI to include relevant packages so that CI can
test that extended attributes are correctly written.

closes: #306
closes: #13203

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-30 12:49:18 +02:00
Christian Brabandt
9eb1ce5315
patch 9.0.1946: filename expansion using ** in bash may fail
Problem:  filename expansion using ** in bash may fail
Solution: Try to enable the globstar setting

Starting with bash 4.0 it supports extended globbing using the globstar
shell option. This makes matching recursively below a certain directory
using the ** pattern work as expected nowadays.  However, we need to
explicitly enable this using the 'shopt -s globstar' bash command.

So let's check the bash environment variable $BASH_VERSINFO (which is
supported since bash 3.0 and conditionally enable the globstar option,
if the major version is at least 4. For older bashs, this at least
shouldn't cause errors (unless one is using really ancient bash 2.X or
something).

closes: #13002
closes: #13144

Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-27 19:08:25 +02:00
Dominique Pellé
4927bc7d27
patch 9.0.1930: compiler warnings with clang-17
Problem:  compiler warnings with clang-17
Solution: Fix function prototypes and function pointer

fix: clang compilation warnings with -Wstrict-prototypes

Change fixes this kind of compilation warnings with clang:
```
proto/if_python3.pro:13:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
   13 | int python3_version();
      |                    ^
      |                     void
```

closes: #13166

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Dominique Pellé <dominique.pelle@tomtom.com>
2023-09-24 16:16:06 +02:00
Bram Moolenaar
545c8a506e patch 9.0.1642: build failure with tiny features
Problem:    Build failure with tiny features.
Solution:   Add #ifdef's.
2023-06-21 15:51:47 +01:00
Bram Moolenaar
55f1b822d8 patch 9.0.1641: the log file does not give information about window sizes
Problem:    The log file does not give information about window sizes.
Solution:   Add a few log messages about obtaining the window size.
2023-06-21 13:42:48 +01:00
Bram Moolenaar
50809a45eb patch 9.0.1572: error messages are not translated
Problem:    Error messages are not translated.
Solution:   Add _().
2023-05-20 16:39:07 +01:00
Bram Moolenaar
79cdf026f1 patch 9.0.1571: RedrawingDisabled not used consistently
Problem:    RedrawingDisabled not used consistently.
Solution:   Avoid RedrawingDisabled going negative.  Set RedrawingDisabled in
            win_split_ins(). (closes #11961)
2023-05-20 14:07:00 +01:00
ichizok
378447fc18 patch 9.0.1544: recent glibc marks sigset() as a deprecated
Problem:    Recent glibc marks sigset() as a deprecated.
Solution:   Use sigaction() in mch_signal() if possible. (Ozaki Kiichi,
            closes #12373)
2023-05-11 22:25:42 +01:00
Michael Jarvis
be9624eb47 patch 9.0.1471: warnings for function declarations
Problem:    Warnings for function declarations.
Solution:   Add argument types. (Michael Jarvis, closes #12277)
2023-04-19 20:28:48 +01:00
Bram Moolenaar
08210f8def patch 9.0.1450: MacOS: building fails if clock_gettime() is not available
Problem:    MacOS: building fails if clock_gettime() is not available.
Solution:   Add a configure check for clock_gettime(). (closes #12242)
2023-04-13 19:15:54 +01:00
Dominique Pelle
e764d1b421 patch 9.0.1403: unused variables and functions
Problem:    Unused variables and functions.
Solution:   Delete items and adjust #ifdefs. (Dominique Pellé, closes #12145)
2023-03-12 21:20:59 +00:00
Yegappan Lakshmanan
14113fdf9c patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file
Problem:    FOR_ALL_ macros are defined in an unexpected file.
Solution:   Move FOR_ALL_ macros to macros.h.  Add FOR_ALL_HASHTAB_ITEMS.
            (Yegappan Lakshmanan, closes #12109)
2023-03-07 17:13:51 +00:00
Bram Moolenaar
5c6a3c9bad patch 9.0.1377: job_status() may return "dead" if the process parent changed
Problem:    job_status() may return "dead" if the process parent changed.
Solution:   Call mch_process_running() to check if the job is still alive.
2023-03-04 13:23:26 +00:00
Yegappan Lakshmanan
a41e221935 patch 9.0.1208: code is indented more than necessary
Problem:    Code is indented more than necessary.
Solution:   Use an early return where it makes sense. (Yegappan Lakshmanan,
            closes #11819)
2023-01-16 18:19:05 +00:00
Bram Moolenaar
06cd14d0bf patch 9.0.1168: code to enable/disable mouse is not from terminfo/termcap
Problem:    Code to enable/disable mouse is not from terminfo/termcap.
Solution:   Request the "XM" entry and use it to set 'ttymouse' if possible.
2023-01-10 12:37:38 +00:00
Bram Moolenaar
afa3f1cc72 patch 9.0.1080: the "kitty" terminfo entry is not widespread
Problem:    The "kitty" terminfo entry is not widespread, resulting in the
            kitty terminal not working properly.
Solution:   Go back to using "xterm-kitty" and avoid the problems it causes in
            another way.
2022-12-19 18:56:48 +00:00
Bram Moolenaar
733a69b29f patch 9.0.0980: the keyboard state response may end up in a shell command
Problem:    The keyboard state response may end up in a shell command.
Solution:   Only request the keyboard protocol state when the typeahead is
            empty, no more commands are following and not exiting.  Add the
            t_RK termcap entry for this.
2022-12-01 12:03:47 +00:00
Bram Moolenaar
4c5678ff0c patch 9.0.0977: it is not easy to see what client-server commands are doing
Problem:    It is not easy to see what client-server commands are doing.
Solution:   Add channel log messages if ch_log() is available.  Move the
            channel logging and make it available with the +eval feature.
2022-11-30 18:12:19 +00:00
Bram Moolenaar
e76062c078 patch 9.0.0965: using one window for executing autocommands is insufficient
Problem:    Using one window for executing autocommands is insufficient.
Solution:   Use up to five windows for executing autocommands.
2022-11-28 18:51:43 +00:00
Bram Moolenaar
c1cf4c9107 patch 9.0.0948: 'ttyfast' is set for arbitrary terminals
Problem:    'ttyfast' is set for arbitrary terminals.
Solution:   Always set 'ttyfast'. (closes #11549)
2022-11-25 15:09:35 +00:00
Bram Moolenaar
63a2e360cc patch 9.0.0930: cannot debug the Kitty keyboard protocol with TermDebug
Problem:    Cannot debug the Kitty keyboard protocol with TermDebug.
Solution:   Add Kitty keyboard protocol support to the libvterm fork.
            Recognize the escape sequences that the protocol generates.  Add
            the 'keyprotocol' option to allow the user to specify for which
            terminal what protocol is to be used, instead of hard-coding this.
            Add recognizing the kitty keyboard protocol status.
2022-11-23 20:20:18 +00:00
Bram Moolenaar
88456cd3c4 patch 9.0.0904: various comment and indent flaws
Problem:    Various comment and indent flaws.
Solution:   Improve comments and indenting.
2022-11-18 22:14:09 +00:00
Yee Cheng Chin
4314e4f7da patch 9.0.0694: no native sound support on Mac OS
Problem:    No native sound support on Mac OS.
Solution:   Add sound support for Mac OS. (Yee Cheng Chin, closes #11274)
2022-10-08 13:50:05 +01:00
Bram Moolenaar
2f7e1b8b40 patch 9.0.0655: passing modifier codes to a shell running in the GUI
Problem:    passing modifier codes to a shell running in the GUI. (Gary
            Johnson)
Solution:   Include modifier codes into the key and drop the modifiers.
2022-10-04 13:17:31 +01:00
Bram Moolenaar
01c34e7d10 patch 9.0.0653: BS and DEL do not work properly in an interacive shell
Problem:    BS and DEL do not work properly in an interacive shell. (Gary
            Johnson)
Solution:   Adjust the length for replaced codes.
2022-10-03 20:24:39 +01:00
Bram Moolenaar
524c853e5e patch 9.0.0606: system() opens a terminal window when "!" is in 'guioptions'
Problem:    system() opens a terminal window when using the GUI and "!" is in
            'guioptions'.
Solution:   Do not use a terminal window when the SHELL_SILENT flag is used.
            (closes #11202)
2022-09-27 15:48:20 +01:00
Yegappan Lakshmanan
6b085b9d73 patch 9.0.0376: clang warns for dead assignments
Problem:    Clang warns for dead assignments.
Solution:   Adjust the code. (Yegappan Lakshmanan, closes #11048)
2022-09-04 12:47:21 +01:00
Yegappan Lakshmanan
aebc6ef7cd patch 9.0.0287: Irix systems no longer exist
Problem:    Irix systems no longer exist.
Solution:   Remove references to Irix. (Yegappan Lakshmanan, closes #10994)
2022-08-27 21:24:26 +01:00
zeertzjq
9b7d2a9596 patch 9.0.0271: using INIT() in non-header files
Problem:    Using INIT() in non-header files.
Solution:   Remove INIT(). (closes #10981)
2022-08-26 10:33:54 +01:00
Bram Moolenaar
a4d158b3c8 patch 9.0.0206: redraw flags are not named specifically
Problem:    Redraw flags are not named specifically.
Solution:   Prefix "UPD_" to the flags, for UPDate_screen().
2022-08-14 14:17:45 +01:00
Bram Moolenaar
cb5ed4d625 patch 9.0.0100: get hit-enter prompt for system() when '!' is in 'guioptions'
Problem:    Get hit-enter prompt for system() when '!' is in 'guioptions'.
Solution:   Do not call wait_return() when not redrawing. (closes #3327)
2022-07-28 12:54:08 +01:00
Bram Moolenaar
abd56da30b patch 8.2.5154: still mentioning version8, some cosmetic issues
Problem:    Still mentioning version8, some cosmetic issues.
Solution:   Prefer mentioning version9, cosmetic improvements.
2022-06-23 20:46:27 +01:00
Bram Moolenaar
155f2d1451 patch 8.2.5141: using "volatile int" in a signal handler might be wrong
Problem:    Using "volatile int" in a signal handler might be wrong.
Solution:   Use "volatile sig_atomic_t".
2022-06-20 13:38:33 +01:00
Bram Moolenaar
509ce03831 patch 8.2.5137: cannot build without the +channel feature
Problem:    Cannot build without the +channel feature. (Dominique Pellé)
Solution:   Add #ifdef around ch_log() calls. (closes #10598)
2022-06-20 11:23:01 +01:00
Bram Moolenaar
1f30caff8b patch 8.2.5129: timeout handling is not optimal
Problem:    Timeout handling is not optimal.
Solution:   Avoid setting timeout_flag twice.  Adjust the pointer when
            stopping the regexp timeout.  Adjust variable name.
2022-06-19 14:36:35 +01:00
Bram Moolenaar
616592e081 patch 8.2.5115: search timeout is overrun with some patterns
Problem:    Search timeout is overrun with some patterns.
Solution:   Check for timeout in more places.  Make the flag volatile and
            atomic.  Use assert_inrange() to see what happened.
2022-06-17 15:17:10 +01:00
Bram Moolenaar
c72e31dfcc patch 8.2.5113: timer becomes invalid after fork/exec, :gui gives errors
Problem:    Timer becomes invalid after fork/exec, :gui gives errors. (Gabriel
            Dupras)
Solution:   Delete the timer befor forking. (closes #10584)
2022-06-16 18:47:20 +01:00
Bram Moolenaar
f78b52ba24 patch 8.2.5067: timer_create is not available on every Mac system
Problem:    Timer_create is not available on every Mac system. (Hisashi T
            Fujinaka)
Solution:   Adjust #ifdef.
2022-06-08 10:48:18 +01:00
Bram Moolenaar
1f89abf69d patch 8.2.5062: Coverity warns for dead code
Problem:    Coverity warns for dead code.
Solution:   Remove the dead code.
2022-06-06 10:07:01 +01:00
Bram Moolenaar
99c48fe997 patch 8.2.5061: C89 requires signal handlers to return void
Problem:    C89 requires signal handlers to return void.
Solution:   Drop RETSIGTYPE and hard-code a void return value.
2022-06-05 22:05:19 +01:00
Paul Ollis
6574577cac patch 8.2.5057: using gettimeofday() for timeout is very inefficient
Problem:    Using gettimeofday() for timeout is very inefficient.
Solution:   Set a platform dependent timer. (Paul Ollis, closes #10505)
2022-06-05 16:55:54 +01:00
Bram Moolenaar
6ed545e797 patch 8.2.4928: various white space and cosmetic mistakes
Problem:    Various white space and cosmetic mistakes.
Solution:   Change spaces to tabs, improve comments.
2022-05-09 20:09:23 +01:00
Bram Moolenaar
249591057b patch 8.2.4911: the mode #defines are not clearly named
Problem:    The mode #defines are not clearly named.
Solution:   Prepend MODE_.  Renumber them to put the mapped modes first.
2022-05-07 20:01:16 +01:00
Bram Moolenaar
c9a9a0ac1e patch 8.2.4742: there is no way to start logging very early in startup
Problem:    There is no way to start logging very early in startup.
Solution:   Add the --log argument.  Include the date in the start message in
            the log file.  Avoid a duplicate message when forking.  Log an
            executed shell command.
2022-04-12 15:09:23 +01:00