summaryrefslogtreecommitdiffstats
path: root/src/filepath.c
AgeCommit message (Collapse)Author
2024-06-18patch 9.1.0499: MS-Windows: doesn't handle symlinks properlyv9.1.0499LemonBoy
Problem: MS-Windows: doesn't handle symlinks properly (Timothy Madden) Solution: Implement lstat() on MS-Windows (author) lstat() differs from stat() in how it handles symbolic links, the former doesn't resolve the symlink while the latter does so. Implement a simple yet effective fallback using Win32 APIs. fixes #14933 closes: #15014 Co-authored-by: K.Takata <kentkt@csc.jp> Signed-off-by: LemonBoy <thatlemon@gmail.com> Signed-off-by: K.Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-03patch 9.1.0465: missing filecopy() functionv9.1.0465Shougo Matsushita
Problem: missing filecopy() function Solution: implement filecopy() Vim script function (Shougo Matsushita) closes: #12346 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-30patch 9.1.0449: MS-Windows: Compiler warningsv9.1.0449Mike Williams
Problem: MS-Windows: Compiler warnings Solution: Resolve size_t to int warnings closes: #14874 A couple of warnings in ex_docmd.c have been resolved by modifying their function argument types, followed by some changes in various function call sites. This also allowed removal of some casts to cope with size_t/int conversion. Signed-off-by: Mike Williams <mrmrdubya@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-16patch 9.1.0341: Problem: a few memory leaks are foundv9.1.0341Christian Brabandt
Problem: a few memory leaks are found (LuMingYinDetect ) Solution: properly free the memory Fixes the following problems: - Memory leak in f_maplist() fixes: #14486 - Memory leak in option.c fixes: #14485 - Memory leak in f_resolve() fixes: #14484 - Memory leak in f_autocmd_get() related: #14474 - Memory leak in dict_extend_func() fixes: #14477 fixes: #14238 closes: #14517 Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-04patch 9.1.0006: is*() and to*() function may be unsafev9.1.0006Keith Thompson
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>
2023-10-16patch 9.0.2033: gcc overflow-warning for f_resolvev9.0.2033Ken Takata
Problem: gcc overflow-warning for f_resolve Solution: use pointer p instead of pointer q[-1] Suppress the following warning: ``` filepath.c: In function ‘f_resolve’: filepath.c:2162:27: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 2162 | q[-1] = NUL; ``` Closes: #13352 closes: #13353 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Ken Takata <kentkt@csc.jp>
2023-08-17patch 9.0.1723: Fix regression in {func} argument of reduce()v9.0.1723zeertzjq
Problem: Fix regression in {func} argument of reduce() Solution: pass function name as string again Before patch 9.0.0548, passing a string as {func} argument of reduce() is treated as a function name, but after patch 9.0.0548 it is treated as an expression instead, which is useless as reduce() doesn't set any v: variables. This PR restores the behavior of {func} before that patch. Also correct an emsg() call, as e_string_list_or_blob_required doesn't contain format specifiers. closes: #12824 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-04-16patch 9.0.1458: buffer overflow when expanding long file namev9.0.1458Yee Cheng Chin
Problem: Buffer overflow when expanding long file name. Solution: Use a larger buffer and avoid overflowing it. (Yee Cheng Chin, closes #12201)
2023-03-11patch 9.0.1400: find_file_in_path() is not reentrantv9.0.1400Bram Moolenaar
Problem: find_file_in_path() is not reentrant. Solution: Instead of global variables pass pointers to the functions. (closes #12093)
2023-01-22patch 9.0.1231: completion of :runtime does not handle {where} argumentv9.0.1231zeertzjq
Problem: Completion of :runtime does not handle {where} argument. Solution: Parse the {where} argument. (closes #11863)
2023-01-09patch 9.0.1166: code is indented more than necessaryv9.0.1166Yegappan Lakshmanan
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
2022-10-19patch 9.0.0795: readblob() always reads the whole filev9.0.0795K.Takata
Problem: readblob() always reads the whole file. Solution: Add arguments to read part of the file. (Ken Takata, closes #11402)
2022-10-08patch 9.0.0693: browse() first argument cannot be a boolv9.0.0693Bram Moolenaar
Problem: browse() first argument cannot be a bool. Solution: Use tv_get_bool_chk() instead of tv_get_number_chk(). (closes #11308)
2022-10-01patch 9.0.0634: evaluating "expr" options has more overhead than neededv9.0.0634Bram Moolenaar
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'.
2022-09-28patch 9.0.0618: calling function for reduce() has too much overheadv9.0.0618Bram Moolenaar
Problem: Calling function for reduce() has too much overhead. Solution: Do not create a funccall_T every time.
2022-09-07patch 9.0.0411: only created files can be cleaned up with one callv9.0.0411Bram Moolenaar
Problem: Only created files can be cleaned up with one call. Solution: Add flags to mkdir() to delete with a deferred function. Expand the writefile() name to a full path to handle changing directory.
2022-09-04patch 9.0.0379: cleaning up after writefile() is a hasslev9.0.0379Bram Moolenaar
Problem: Cleaning up after writefile() is a hassle. Solution: Add the 'D' flag to defer deleting the written file. Very useful in tests.
2022-09-02patch 9.0.0362: expanding ":e %" does not work for remote filesv9.0.0362Bram Moolenaar
Problem: Expanding ":e %" does not work for remote files. Solution: If the "%" or "#" file does not exist add the expansion anyway.
2022-09-01patch 9.0.0345: error message for list argument could be clearerv9.0.0345Bram Moolenaar
Problem: Error message for list argument could be clearer. Solution: Include the argument number. (Yegappan Lakshmanan, closes #11027)
2022-08-27patch 9.0.0287: Irix systems no longer existv9.0.0287Yegappan Lakshmanan
Problem: Irix systems no longer exist. Solution: Remove references to Irix. (Yegappan Lakshmanan, closes #10994)
2022-08-26patch 9.0.0278: the +wildignore feature is nearly always availablev9.0.0278Bram Moolenaar
Problem: The +wildignore feature is nearly always available. Solution: Graduate +wildignore for consistency.
2022-08-25patch 9.0.0265: no good reason why the "gf" command isn't in the tiny versionv9.0.0265Bram Moolenaar
Problem: No good reason why the "gf" command is not in the tiny version. Solution: Graduate the file_in_path feature.
2022-08-20patch 9.0.0231: expanding "**" may loop forever with directory linksv9.0.0231Bram Moolenaar
Problem: Expanding "**" may loop forever with directory links. Solution: Check for being interrupted. (closes #10946)
2022-07-23patch 9.0.0063: too many type casts for dict_get functionsv9.0.0063Bram Moolenaar
Problem: Too many type casts for dict_get functions. Solution: Change the key argument from "char_u *" to "char *".
2022-07-02patch 9.0.0028: MS-Windows: tests fail if there is a "runtime" directoryv9.0.0028Bram Moolenaar
Problem: MS-Windows: tests fail if there is a stray "runtime" directory. Solution: Only use a "runtime" directory if it contains "defaults.vim".
2022-06-20patch 8.2.5138: various small issuesv8.2.5138Bram Moolenaar
Problem: Various small issues. Solution: Various small improvments.
2022-06-11patch 8.2.5077: various warnings from clang on MS-Windowsv8.2.5077Yegappan Lakshmanan
Problem: Various warnings from clang on MS-Windows. Solution: Avoid the warnings. (Yegappan Lakshmanan, closes #10553)
2022-05-16patch 8.2.4963: expanding path with "/**" may overrun end of bufferv8.2.4963Bram Moolenaar
Problem: Expanding path with "/**" may overrun end of buffer. Solution: Use vim_snprintf().
2022-05-09patch 8.2.4928: various white space and cosmetic mistakesv8.2.4928Bram Moolenaar
Problem: Various white space and cosmetic mistakes. Solution: Change spaces to tabs, improve comments.
2022-04-28patch 8.2.4841: empty string considered an error for expand()v8.2.4841Bram Moolenaar
Problem: Empty string considered an error for expand() when 'verbose' is set. (Christian Brabandt) Solution: Do not give an error for an empty result. (closes #10307)
2022-04-28patch 8.2.4838: checking for absolute path is not trivialv8.2.4838LemonBoy
Problem: Checking for absolute path is not trivial. Solution: Add isabsolutepath(). (closes #10303)
2022-04-04patch 8.2.4683: verbose check with dict_find() to see if a key is presentv8.2.4683Yegappan Lakshmanan
Problem: Verbose check with dict_find() to see if a key is present. Solution: Add dict_has_key(). (Yegappan Lakshmanan, closes #10074)
2022-04-03patch 8.2.4679: cannot have expandcmd() give an error message for mistakesv8.2.4679Yegappan Lakshmanan
Problem: Cannot have expandcmd() give an error message for mistakes. Solution: Add an optional argument to give errors. Fix memory leak when expanding files fails. (Yegappan Lakshmanan, closes #10071)
2022-04-03patch 8.2.4671: 'wildignorecase' is sometimes not used for glob()v8.2.4671LemonBoy
Problem: 'wildignorecase' is sometimes not used for glob(). Solution: Also use 'wildignorecase' when there are no wildcards. (closes #10066, closes #8350)
2022-03-31patch 8.2.4653: "import autoload" does not check the file namev8.2.4653Bram Moolenaar
Problem: "import autoload" does not check the file name. Solution: Give an error if the file is not readable. (closes #10049)
2022-03-10patch 8.2.4535: filename modifer ":8" removes the filenamev8.2.4535Christian Brabandt
Problem: Filename modifer ":8" removes the filename. Solution: Use strncpy() instead of vim_strncpy(). (Christian Brabandt, closes #9918, closes #8600)
2022-02-19patch 8.2.4418: crash when using special multi-byte characterv8.2.4418Bram Moolenaar
Problem: Crash when using special multi-byte character. Solution: Don't use isalpha() for an arbitrary character.
2022-02-09patch 8.2.4337: part of condition is always truev8.2.4337=?UTF-8?q?Dundar=20G=C3=B6c?=
Problem: Part of condition is always true. Solution: Remove that part of the condition. (closes #9729)
2022-02-03patch 8.2.4289: warnings reported by MSVCv8.2.4289K.Takata
Problem: Warnings reported by MSVC. Solution: Rename variables and other fixes. (Ken Takata, closes #9689)
2022-01-31patch 8.2.4273: the EBCDIC support is outdatedv8.2.4273Bram Moolenaar
Problem: The EBCDIC support is outdated. Solution: Remove the EBCDIC support.
2022-01-12patch 8.2.4070: using uninitialized memory when reading empty filev8.2.4070Dominique Pelle
Problem: Using uninitialized memory when reading empty file. Solution: Check for empty file before checking for NL. (Dominique Pellé, closes #9511)
2022-01-08patch 8.2.4043: using int for second argument of ga_init2()v8.2.4043Bram Moolenaar
Problem: Using int for second argument of ga_init2(). Solution: Remove unnessary type cast (int) when using sizeof().
2022-01-04patch 8.2.4005: error messages are spread outv8.2.4005Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-02patch 8.2.3983: error messages are spread outv8.2.3983Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more error messages to errors.h.
2022-01-01patch 8.2.3967: error messages are spread outv8.2.3967Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-12-31patch 8.2.3961: error messages are spread outv8.2.3961Bram Moolenaar
Problem: Error messages are spread out. Solution: Move more errors to errors.h.
2021-11-18patch 8.2.3618: getcwd() is unclear about how 'autochdir' is usedv8.2.3618Bram Moolenaar
Problem: getcwd() is unclear about how 'autochdir' is used. Solution: Update the help for getcwd(). Without any arguments always return the actual current directory. (closes #9142)
2021-07-27patch 8.2.3229: Vim9: runtime and compile time type checks are not the samev8.2.3229Yegappan Lakshmanan
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)
2021-07-24patch 8.2.3215: Vim9: argument types are not checked at compile timev8.2.3215Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks. Sort the argument lists. (Yegappan Lakshmanan, closes #8626)
2021-07-23patch 8.2.3206: Vim9: argument types are not checked at compile timev8.2.3206Yegappan Lakshmanan
Problem: Vim9: argument types are not checked at compile time. Solution: Add several more type checks. (Yegappan Lakshmanan, closes #8611)