aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
Commit message (Collapse)AuthorAge
...
| | | * Add os_getfullenv_size/os_copyfullenvJames McCoy2019-12-11
| | | |
| | | * jobstart now supports env/clear_envMatthieu Coudron2019-12-11
| | | | | | | | | | | | | | | | to modify the environment of the launched job.
| | | * TUI: use stdio names instead of magic numbers #11410erw72019-11-17
| | | |
| | | * TUI/thread: guard env map from potential race with unibilium #11259erw72019-10-20
| | | | | | | | | | | | unibi_from_term calls getenv internally, so exclusive control is required.
| | | * vim-patch 8.1.0361: remote user not used for completionerw72019-10-14
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Remote user not used for completion. (Stucki) Solution: Use $USER too. (Dominique Pelle, closes #3407) https://github.com/vim/vim/commit/6b0b83f768cf536b34ce4d3f2de6bf62324229aa
| | | * vim-patch 8.1.0084: user name completion does not work on MS-Windowserw72019-10-13
| | | | | | | | | | | | | | | | | | | | | | | | Problem: User name completion does not work on MS-Windows. Solution: Use NetUserEnum() to get user names. (Yasuhiro Matsumoto) https://github.com/vim/vim/commit/828c3d70833a0689cc07581f2a67d06430675da5
| | | * Fix potential deadlock #11151erw72019-10-04
| | | | | | | | | | | | | | | | | | | | ELOG may call os_getenv and os_setenv internally. In that case, a deadlock occurs.
| | | * shell: improve displaying of pulse (#11130)Daniel Hahler2019-10-02
| | | | | | | | | | | | | | | | | | | | | | | | - output "[...]" to indicate throttling is being used, instead of just an empty line - go to beginning of line after displaying the pulse, so that following output is displayed over it
| | | * Revert "win/os_env_exists(): workaround libuv bug #10734"Daniel Hahler2019-09-25
| | | | | | | | | | | | | | | | This reverts commit 278c5d452c2cbc436a9cc317407ae6021a226c3a.
| | | * env: use putenv_s for LC_ALL, LANG, etc. #11050erw72019-09-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ":lang messages en_US.UTF-8" no longer overrides the language detected from the environment (at startup). Solution: In os_setenv, special-case "LC_ALL", "LANG", et al. to use putenv_s instead of uv_os_setenv. fixes #11045
* | | | libcall: Use "int" for number argumentJames McCoy2020-08-08
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libcall family of functions need to use "int" for both input and output. The output side was fixed in 9c42232 but I forgot about the input side. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch libcallnr # Your branch is up to date with 'upstream/master'. # # Changes to be committed: # modified: src/nvim/eval/funcs.c # modified: src/nvim/os/dl.c #
* / / 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'
* / libcallnr: Use int, not int64_t, as the return type for Vim compatJames McCoy2019-12-15
|/ | | | | | | | | | Vim's documentation simply states that libcallnr() should be used "for a function that returns an int". Based on the tests, code, and common syscall interfaces, this should likely be taken literally instead of trying to apply some well-defined type lipstick. Notably, this change fixes Test_libcall_libcallnr on hppa (a 32-bit big-endian system).
* refactor: allow us to process a child queue only while waiting on inputBjörn Linse2019-09-08
|
* stdpaths_get_xdg_var: consider empty env vars #10953Daniel Hahler2019-09-06
| | | | | Without this "sysinit uses VIM if XDG_CONFIG_DIRS unset" fails with an existing `/etc/xdg/nvim/sysinit.vim` file, because `XDG_CONFIG_DIRS=` is not considered, but the default ("/etc/xdg") used then.
* Log signals handled in deadly_signal (#10939)Daniel Hahler2019-09-04
|
* Revisit out_data_decide_throttleDaniel Hahler2019-08-30
| | | | | | Pulse every 0.1s only. This makes `!yes` look much better (less busy).
* paste: WIP #4448Justin M. Keyes2019-08-27
|
* vim-patch:8.1.1897: may free memory twice when out of memory (#10827)Jan Edmund Lazo2019-08-22
| | | | | | Problem: May free memory twice when out of memory. Solution: Check that backslash_halve_save() returns a different pointer. (Dominique Pelle, closes vim/vim#4847) https://github.com/vim/vim/commit/f1552d07d715b437d941659479942c2543b02bd4
* 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); | ^~~~~~~~~~~~~~~~~
* os/: remove redundant defineJustin M. Keyes2019-08-15
|
* 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
* Merge #10098 'win: fix msg_puts_printf()'Justin M. Keyes2019-08-12
|\
| * Fix problems with message catalog directoryerw72019-06-09
| | | | | | | | | | | | | | | | - In appimage, the message catalog is not used because there is no message catalog in LOCALE_INSTALL_DIR. Therefore, change to exepath/../share/locale instead of LOCALE_INSTALL_DIR. - The old vim style($runtime/lang) is no longer used. Thus all relevant code is removed.
* | win/env: Vim-compat: Empty string deletes env var #10743erw72019-08-11
| | | | | | | | | | | | | | | | - Windows: `set FOO=` deletes environment variable FOO, and there is no way to set empty string expect by calling the API. - Vim-compatible: `:let $FOO=""` deletes the environment variable. - See also Test_WindowsHome(). ref: https://github.com/neovim/neovim/pull/10657#issuecomment-516368089
* | win: expand nested env var #10662erw72019-08-11
| | | | | | | | Vim-compatible behavior for a Windows edge case.
* | win/os_env_exists(): workaround libuv bug #10734Justin M. Keyes2019-08-10
| | | | | | | | | | | | | | | | | | | | os_env_exists() fails on MSVC build: os_env_exists:104: uv_os_getenv(EMPTY_VAR) failed: -4094 UNKNOWN - Revert 396a3945c4eba733b3a99a7ded217af83a400791 - HACK: Windows: return TRUE if uv_os_getenv() returns UV_UNKNOWN, until libuv bug is fixed: https://github.com/libuv/libuv/issues/2413 ref https://github.com/neovim/neovim/commit/396a3945c4eba733b3a99a7ded217af83a400791#r34642361
* | channels: reflect exit due to signals in exit status code (#10573)Daniel Hahler2019-08-09
| | | | | | | | | | Uses `128 + term_signal` in case of exit due to a signal. Fixes https://github.com/neovim/neovim/issues/10571.
* | f_environ: cleanup/refactorDaniel Hahler2019-08-06
| | | | | | | | | | - use os_getenvname_at_index / os_getenv - f_getenv: empty (*p == NUL) is not null (undefined)
* | vim-patch:8.1.0572: stopping a job does not work properly on OpenBSDDaniel Hahler2019-07-30
| | | | | | | | | | | | | | | | | | | | | | | | Problem: Stopping a job does not work properly on OpenBSD. Solution: Do not use getpgid() to check the process group of the job processs ID, always pass the negative process ID to kill(). (George Koehler, closes vim/vim#3656) https://github.com/vim/vim/commit/76ab4fd61901090e6af3451ca6c5ca0fc370571f Ref: https://github.com/neovim/neovim/issues/9704 Ref: https://github.com/neovim/neovim/issues/10182#issuecomment-514450069 Closes https://github.com/neovim/neovim/pull/10660
* | 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.
* | env: invalid pointer after os_setenv() #10558erw72019-07-23
| |
* | 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
* | refactor: use int for Columns and RowsBjörn Linse2019-07-19
| |
* | 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.
* | viml/profile: revert gettimeofday() #10488Justin M. Keyes2019-07-13
| | | | | | | | | | | | | | e2ce5ff9d616 was proven to be bogus, so revert it. close #10328 ref #10356 ref #10452
* | viml/reltime(): allow negative result #10453Justin M. Keyes2019-07-09
| | | | | | | | | | | | - define proftime_T as signed integer - profile_sub(): allow negative result closes #10452
* | CI: improve gcov handling #10404Daniel Hahler2019-07-07
| | | | | | | | | | | | | | | | | | - Move __gcov_flush to process_spawn, for more reliable coverage tracking of subprocesses - Travis: use GCOV_ERROR_FILE - codecov: use "-X fix" to skip "fixing" uploaded coverage data; it should be handled by codecov's backend instead. - AppVeyor: no $PATH mangling, which breaks with the improved coverage tracking due to missing .dll in PATH.
* | 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.
* | viml/profile: switch to uv_gettimeofday() #10356Justin M. Keyes2019-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance of high-resolution time (clock_gettime via uv_hrtime) is expensive on some systems. For profiling VimL, syntax, etc., we don't care about nanosecond-precision and monotonicity edge-cases, so avoid uv_hrtime(). closes #10328 From the uv__hrtime() source: https://github.com/libuv/libuv/blob/0cdb4a5b4b706d0e09413d9270da28f9a88dc083/src/unix/linux-core.c#L442-L462 /* Prefer CLOCK_MONOTONIC_COARSE if available but only when it has * millisecond granularity or better. CLOCK_MONOTONIC_COARSE is * serviced entirely from the vDSO, whereas CLOCK_MONOTONIC may * decide to make a costly system call. */ This micro-benchmark (Debug build) shows negligible differences on my system: #include <sys/time.h> ... proftime_T tm = profile_start(); int trials = 999999; int64_t t = 0; struct timeval tv; for (int i = 0; i < trials; i++) { t += gettimeofday(&tv,NULL); } tm = profile_end(tm); ILOG("%d trials of gettimeofday: %s", trials, profile_msg(tm)); tm = profile_start(); for (int i = 0; i < trials; i++) { t += os_hrtime(); } tm = profile_end(tm); ILOG("%d trials of os_hrtime: %s", trials, profile_msg(tm)); tm = profile_start(); for (int i = 0; i < trials; i++) { t += os_utime(); } tm = profile_end(tm); ILOG("%d trials of os_utime: %s", trials, profile_msg(tm)); ILOG("%zu", t);
* | os: close library even if uv_dlopen() failserw72019-06-23
| |
* | gcov: use __gcov_flush instead of __gcov_dump (#10260)Daniel Hahler2019-06-18
| | | | | | | | | | | | This restores missing coverage again. Move it to process_spawn in os/pty_process_unix.c, since it seems to break printargs-test on Windows/AppVeyor otherwise (#10248).
* | TUI: set os/input.c:global_fd to input->in_fd #10174erw72019-06-10
|/ | | | | | | | | | | | | Problem: When we changed startup to wait for the TUI (like a remote UI), we forgot to set os/input.c:global_fd. That used to be done by input_start(). Solution: Initialize os/input.c:global_fd before initializing libtermkey (termkey_new_abstract) so that tui_get_stty_erase() and friends can inspect the correct fd. fixes #10134 close #10174
* vim-patch:8.1.0211: expanding a file name "~" results in $HOMEJan Edmund Lazo2019-05-25
| | | | | | Problem: Expanding a file name "~" results in $HOME. (Aidan Shafran) Solution: Change "~" to "./~" before expanding. (closes vim/vim#3072) https://github.com/vim/vim/commit/00136dc321586800986e8f743c2f108f5eecbf92
* 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