Age | Commit message (Collapse) | Author |
|
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>
|
|
Problem: Various Typos
Solution: Fix Typos
This is a collection of typo related commits.
closes: #12753
closes: #13016
Co-authored-by: Adri Verhoef <a3@a3.xs4all.nl>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: Viktor Szépe <viktor@szepe.net>
Co-authored-by: nuid64 <lvkuzvesov@proton.me>
Co-authored-by: Meng Xiangzhuo <aumo@foxmail.com>
Co-authored-by: Dominique Pellé <dominique.pelle@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
|
|
Problem: find_file_in_path() is not reentrant.
Solution: Instead of global variables pass pointers to the functions.
(closes #12093)
|
|
Problem: Using sizeof() and subtract array size is tricky.
Solution: Use offsetof() instead. (closes #11926)
|
|
Problem: Completion of :runtime does not handle {where} argument.
Solution: Parse the {where} argument. (closes #11863)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11792)
|
|
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11787)
|
|
Problem: Evaluating "expr" options has more overhead than needed.
Solution: Use call_simple_func() for 'foldtext', 'includeexpr', 'printexpr',
"expr" of 'spellsuggest', 'diffexpr', 'patchexpr', 'balloonexpr',
'formatexpr', 'indentexpr' and 'charconvert'.
|
|
Problem: Various small issues.
Solution: Various small fixes.
|
|
Problem: Some values of 'path' and 'tags' do not work in the tiny version.
Solution: Graduate the +path_extra feature.
|
|
Problem: No good reason why the "gf" command is not in the tiny version.
Solution: Graduate the file_in_path feature.
|
|
Problem: Expanding file names fails in directory with more than 255
entries.
Solution: Use an int instead of char_u to count. (John Drouhard,
closes #10818)
|
|
Problem: The EBCDIC support is outdated.
Solution: Remove the EBCDIC support.
|
|
Problem: Cannot use an import in 'includeexpr'.
Solution: Set the script context when evaluating 'includeexpr'
|
|
Problem: 'foldtext' is evaluated in the current script context.
Solution: Use the script context where the option was set.
|
|
Problem: Using int for second argument of ga_init2().
Solution: Remove unnessary type cast (int) when using sizeof().
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
|
|
Problem: Various spelling mistakes in comments.
Solution: Fix the mistakes. (Dominique Pellé, closes #9416)
|
|
Problem: No ASAN support for MSVC.
Solution: Add ASAN support and fix a coupld of uncovered problems. (Yegappan
Lakshmanan, closes #9357)
|
|
Problem: :find test fails.
Solution: Put length check inside if block.
|
|
Problem: Crash when using CTRL-W f without finding a file name.
Solution: Bail out when the file name length is zero.
|
|
Problem: Vim9: runtime and compile time type checks are not the same.
Solution: Add more runtime type checks for builtin functions. (Yegappan
Lakshmanan, closes #8646)
|
|
Problem: :find searches non-existing directories.
Solution: Check the path is not "..". Update help. (Christian Brabandt,
closes #8612, closes #8533)
|
|
Problem: Tests failing because there is no error for float to string
conversion.
Solution: Change the check for failure to check for correct result. Make
some conversions strict in Vim9 script.
|
|
Problem: "gF" does not use line number after file in Visual mode.
Solution: Look for ":123" after the Visual area. (closes #6952)
|
|
Problem: Vim9: leaking memory when using continuation line.
Solution: Keep a pointer to the continuation line in evalarg_T. Centralize
checking for a next command.
|
|
Problem: Simplify() does not remove slashes from "///path".
Solution: Reduce > 2 slashes to one. (closes #6263)
|
|
Problem: Unnecessary type casts for vim_strnsave().
Solution: Remove the type casts.
|
|
Problem: Clearing a struct is verbose.
Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER().
|
|
Problem: "gF" does not work on output of "verbose command".
Solution: Recognize " line " and translations. (closes #5391)
|
|
Problem: Using old C style comments.
Solution: Use // comments where appropriate.
|
|
Problem: Some MB_ macros are more complicated than necessary. (Dominique
Pelle)
Solution: Simplify the macros. Expand inline.
|
|
Problem: Code for handling file names is spread out.
Solution: Move code to new filepath.c file. Graduate FEAT_MODIFY_FNAME.
|
|
Problem: Functions used in one file are global.
Solution: Add "static". (Yegappan Lakshmanan, closes #4840)
|
|
Problem: Alloc() returning "char_u *" causes a lot of type casts.
Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to
check the simple allocations.
|
|
Problem: Unnecessary type casts.
Solution: Remove type casts from alloc() and lalloc() calls. (Mike Williams)
|
|
Problem: Using "int" for alloc() often results in compiler warnings.
Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim
only works with 32 bit ints anyway.
|
|
Problem: The do_tag() function is too long.
Solution: Factor parts out to separate functions. Move simplify_filename()
to a file where it fits better. (Andy Massimino, closes #4195)
|
|
Problem: "gf" does not always work when URL has a port number. (Jakob
Schöttl)
Solution: When a URL is recognized also accept ":". (closes #4082)
|
|
Problem: Code related to findfile() is spread out.
Solution: Put findfile() related code into a new source file. (Yegappan
Lakshmanan, closes #3934)
|