aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/fs.c
Commit message (Collapse)AuthorAge
...
| * refactor: fix clang-tidy warningsdundargoc2022-11-06
| | | | | | | | | | | | | | | | Enable and fix bugprone-misplaced-widening-cast warning. Fix some modernize-macro-to-enum and readability-else-after-return warnings, but don't enable them. While the warnings can be useful, they are in general too noisy to enable.
* | feat: ":write ++p" creates parent dirs #20835Victor Blanchard2022-11-06
|/ | | | | | | | | | | - `:write ++p foo/bar/baz.txt` should create parent directories `foo/bar/` if they do not exist - Note: `:foo ++…` is usually for options. No existing options have a single-char abbreviation (presumably by design), so it's safe to special-case `++p` here. - Same for `writefile(…, 'foo/bar/baz.txt', 'p')` - `BufWriteCmd` can see the ++p flag via `v:cmdarg`. closes #19884
* vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)dundargoc2022-09-18
| | | | | | | Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9
* refactor: replace char_u with charDundar Göc2022-08-31
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with char 4 (#19987)dundargoc2022-08-30
| | | | | | | * refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u with charDundar Göc2022-08-29
| | | | Work on https://github.com/neovim/neovim/issues/459
* revert: "jobstart(): Fix hang on non-executable cwd #9204" (#19826)zeertzjq2022-08-18
| | | | | This reverts commit c4c74c3883aa3122c0c877ca8dd7b26beb5cc4aa. LibUV already gives an error for this, so this isn't needed.
* refactor: replace char_u with charDundar Goc2022-08-12
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: use CLEAR_FIELD and CLEAR_POINTER macros (#19709)zeertzjq2022-08-11
| | | | | | | vim-patch:8.2.0559: clearing a struct is verbose Problem: Clearing a struct is verbose. Solution: Define and use CLEAR_FIELD() and CLEAR_POINTER(). https://github.com/vim/vim/commit/a80faa8930ed5a554beeb2727762538873135e83
* refactor: replace char_uDundar Goc2022-07-02
| | | | Work on https://github.com/neovim/neovim/issues/459
* feat: stdpath('run'), /tmp/nvim.user/ #18993Justin M. Keyes2022-06-30
| | | | | | | | | | | | | | | | Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* refactor: convert macros to all-caps (#17895)dundargoc2022-04-24
| | | Closes https://github.com/neovim/neovim/issues/6297
* refactor(lua): cleanup and docs for threadsbfredl2022-02-26
|
* feat(lua): add proper support of luv threadserw72022-02-26
|
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
* refactor: remove redundant char casts #15888dundargoc2021-10-04
|
* Refactor/uncrustify (#15790)dundargoc2021-09-29
| | | | | | | | | | | | | * refactor: format with uncrustify * fixup(dundar): fix functions comments * fixup(dundar): remove space between variable and ++/-- * fixup(dundar): better workaround for macro attributes This is done to be able to better use uncrustify rules for macros * fixup(justin): make preprocessors follow neovim style guide
* refactor: format files with uncrustify #15663dundargoc2021-09-14
|
* chore: use codespell to spell check #15016dundargoc2021-07-07
|
* coverity/331377: os_fopen: Remove invalid iflags assertJames McCoy2021-05-06
| | | | | | If the O_* flags were non-zero, then ORing the flags would always be true. However, the O_* flags aren't guaranteed to be non-zero, so the assert is invalid in the first place.
* Merge remote-tracking branch 'upstream/master' into fileinfo-garbageJames McCoy2020-07-31
|\
| * Change to canonicalize only when reparse point in includederw72020-04-02
| |
| * Change resolve() to resolve symbolic links on Windowserw72020-04-02
| |
* | fs: Ensure FileInfo struct is initializedJames McCoy2020-07-31
|/ | | | | | | | | | | | | | | | | | | Zero out the caller's FileInfo in all the functions which populate the struct. The contents are considered private, so we need to ensure it's initialized. If the stat call fails, the buffer we get back from libuv may not have any valid data in it, so don't copy it into the caller's FileInfo. This was happening, expectedly, in functional/ex_cmds/write_spec.lua's "write errors out correctly", which caused it to fail in certain environments: test/functional/ex_cmds/write_spec.lua:130: Expected objects to be the same. Passed in: (string) 'Vim(write):E212: Can't open file for writing: not a directory' Expected: (string) 'Vim(write):E166: Can't open linked file for writing'
* build/win: fix warningsJustin M. Keyes2019-08-15
| | | | | | | | | | | | | | | | | | | | | ../src/nvim/os/fs.c: In function 'os_can_exe': ../src/nvim/os/fs.c:247:27: warning: passing argument 1 of 'is_executable_ext' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 247 | if (is_executable_ext(name, abspath)) { | ^~~~ In file included from ../src/nvim/os/fs.c:36: src/nvim/auto/os/fs.c.generated.h:7:38: note: expected 'char *' but argument is of type 'const char *' 7 | static _Bool is_executable_ext(char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1); | ~~~~~~^~~~ ../src/nvim/os/fs.c: In function 'os_resolve_shortcut': ../src/nvim/os/fs.c:1183:56: warning: conversion from 'size_t' {aka 'const long long unsigned int'} to 'int' may change value [-Wconversion] 1183 | const int conversion_result = utf8_to_utf16(fname, len, &p); | ^~~ ../src/nvim/os/fs.c:1211:19: warning: declaration of 'conversion_result' shadows a previous local [-Wshadow] 1211 | const int conversion_result = utf16_to_utf8(wsz, -1, &rfname); | ^~~~~~~~~~~~~~~~~ ../src/nvim/os/fs.c:1183:15: note: shadowed declaration is here 1183 | const int conversion_result = utf8_to_utf16(fname, len, &p); | ^~~~~~~~~~~~~~~~~
* utf16_to_utf8: align with libuvJustin M. Keyes2019-08-15
| | | | | | | | | - take a size parameter - return libuv error code - handle error in caller only (avoid redundant messages) https://github.com/libuv/libuv/commit/53995a3825d23eacd01e2bcfa35642c4a188d32b https://github.com/libuv/libuv/commit/4c945f49365ab4d6e1b07bf0ef2893455dc04622
* utf8_to_utf16: align with libuvJustin M. Keyes2019-08-15
| | | | | | | | | | - take a size parameter - always NUL-terminate the result - return libuv error code - handle error in caller only (avoid redundant messages) https://github.com/libuv/libuv/commit/53995a3825d23eacd01e2bcfa35642c4a188d32b https://github.com/libuv/libuv/commit/4c945f49365ab4d6e1b07bf0ef2893455dc04622
* os/fs: introduce os_fopen()Justin M. Keyes2019-07-25
| | | | | | | Windows: Using fopen() directly may need UTF-16 filepath conversion. To achieve that, os_fopen() goes through os_open(). fix #10586
* vim-patch:8.1.1740: exepath() doesn't work for "bin/cat" (#10556)Daniel Hahler2019-07-24
| | | | | | | | Problem: Exepath() doesn't work for "bin/cat". Solution: Check for any path separator. (Daniel Hahler, closes vim/vim#4724, closes vim/vim#4710) https://github.com/vim/vim/commit/d08b8c4c04db9433340df38d21f0e26878f28421 Fixes https://github.com/neovim/neovim/issues/10554.
* os_can_exe: remove char_uJustin M. Keyes2019-07-21
|
* win: jobstart(), system(): $PATHEXT-resolve exeJustin M. Keyes2019-07-21
| | | | | | | | | | | | Windows: In order for jobstart(['foo']), system(['foo']) to find "foo.cmd", we must replace "foo" with "foo.cmd" before sending `argv` to process_spawn(). Rationale: jobstart([…]), system([…]) "executable" semantics should be consistent with the VimL executable() function. fix #9569 related: #10554
* Fix is_executable_in_path() on Windows (#10468)erw72019-07-15
| | | | | | | | * Fix problem that 1byte extra memory was allocated in is_executable_in_path * Revert "Revert "tests: executable_spec: enable pending test #10443" (#10454)" This reverts commit 13fbeda0e56db36aeeb865bb5b33d13f69b2fdbc.
* win,fs.c: Fix is_executable_ext #10209erw72019-07-04
| | | | | | | | | | | Fix issue that increment expression is executable and pointer ext pointing out of the buffer, if the pointer ext points to the terminating NUL. * Change termination condition judgment to one place * Change first condition judgment Change to not evaluate *(ext -1) in the first condition judgment. * Change to use copy_option_part instead of STRLCPY
* fileio.c: eliminate set_file_time() #10357Justin M. Keyes2019-06-30
| | | Introduce os_file_settime(), remove cruft.
* lua/shared: share trim() implJustin M. Keyes2019-05-20
|
* fileio: set group of backup fileJustin M. Keyes2019-05-20
| | | | | | | | | | Restores code removed in #9709. uv_fs_copyfile() copies the perm bits but not the group name. https://github.com/libuv/libuv/pull/1547 ref #9709 ref #8288
* Merge #9709 'fileio: use os_copy to create backups'Justin M. Keyes2019-05-20
|\ | | | | | | ref #8288
| * docs: explicitly state return value on successSaid Al Attrach2019-03-30
| |
| * fs: add os_copy function that uses uv_fs_copyfileSaid Al Attrach2019-03-10
| |
* | test: "$PATHEXT=::"Justin M. Keyes2019-04-02
| |
* | fs.c: fix is_executable_ext()erw72019-04-02
| | | | | | | | | | | | | | - Corresponds to the case where pathext contains a zero-length extension. - Remove unnecessary break statements. - Fix function attributes.
* | [ci skip] fs.c: fix commenterw72019-04-01
| |
* | fs.c: Move sh check of is_executable_ext to outside of looperw72019-04-01
| |
* | fs.c: Simplify calling is_executable_exterw72019-04-01
| |
* | fs.c: fix is_executable_exterw72019-04-01
| | | | | | | | | | | | - Fix the problem of checking the extension in a UNIX like shell. - Fix the problem of not checking the existence of the file when the pathext contains an extension.
* | fs.c: eliminate is_extension_executableJustin M. Keyes2019-04-01
| | | | | | | | Add this functionality to is_executable_ext() instead.
* | is_extension_executable: simplify check for unix-style shellJustin M. Keyes2019-04-01
| | | | | | | | mch_expand_wildcards does it this way, it's probably good enough.