aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
Commit message (Collapse)AuthorAge
...
* vim_getenv: Use v:progpath instead of os_exepath.Justin M. Keyes2017-05-15
|
* os_term_is_nice: Return true for rxvt and iTerm.Justin M. Keyes2017-04-22
|
* *: Add comment to all C filesZyX2017-04-19
|
* os/env: Fix “invalid pointer to local” false positiveZyX2017-04-16
|
* win: os_shell_is_cmdexe() + testsJustin M. Keyes2017-04-12
|
* win: os_get_hostname() #5416 (#6413)Justin M. Keyes2017-04-07
|
* 'guicursor': Disable by default for unknown terminals.Justin M. Keyes2017-04-04
| | | | | | | User can still set guicursor explicitly in init.vim. Closes #5990 Closes #6403
* fileio: Refactor msg_add_fname to something which needs no commentsZyX2017-04-03
|
* coverity/161195: Increase scope of exe_nameJames McCoy2017-03-29
| | | | | Since exe_name is a stack allocated array, we need it to be in scope for the lifetime that vim_path points to it.
* vim_getenv: $VIMRUNTIME fallback: ../share/nvim/runtime (#6223)Justin M. Keyes2017-03-06
| | | | | | | | | Do this on all systems, so that portable builds work everywhere. This allows us to ship archives with this folder structure: bin/nvim share/nvim/runtime then ./bin/nvim works without the user needing to explicitly set VIMRUNTIME.
* os/*: Use os_buf instead of NameBuff, IObuff.Justin M. Keyes2017-02-12
|
* coverity/155968: resource leakJustin M. Keyes2017-02-09
|
* vim-patch:8.0.0280Justin M. Keyes2017-02-04
| | | | | | | | | | patch 8.0.0280: problem setting multi-byte environment var on MS-Windows Problem: On MS-Windows setting an environment variable with multi-byte strings does not work well. Solution: Use wputenv when possible. (Taro Muraoka, Ken Takata) 7c23d1d9d9cc
* win: Append process dir to $PATHJustin M. Keyes2017-02-04
| | | | | | | | This allows executables to be found by :!, system(), and executable() if they live next to ("sibling" to) nvim.exe. This is what gvim on Windows does, and also matches the behavior of Win32 SearchPath(). https://github.com/vim/vim/blob/c4a249a736d40ec54794827ef95804c225d0e38f/src/os_win32.c#L354-L370
* refactor: Remove strncpy/STRNCPY. (#6008)Justin M. Keyes2017-01-26
| | | | | | | | | | | | | | | Closes #731 References #851 Note: This does not remove some intentional legacy usages of strncpy. - memcpy isn't equivalent because it doesn't check the string length of `src`, and doesn't zero-out the remainder of `dst`. - xstrlcpy isn't equivalent because it doesn't zero-out the remainder of `dst`. Some Vim logic depends on that (e.g. ex_append which calls vim_strnsave). Helped-by: Douglas Schneider <ds3@ualberta.ca> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: James McCoy <jamessan@jamessan.com>
* test: expand_env_esc()Justin M. Keyes2017-01-21
| | | | | | Test expand_env_esc() using the same parameters reported in #3725. Closes #3725
* Windows: vim_getenv(): Find runtime relative to nvim. #3303 (#5929)Justin M. Keyes2017-01-11
| | | | | | | | | | | | In Windows we cannot rely on absolute install paths to point to the location of the runtime. Vim uses the path of the current binary as a possible location for the runtime folder. In Neovim the install location places the runtime folder in ../share/nvim/runtime. In Vim this logic is guarded by USE_EXE_NAME, which is defined for win32 and macOS. TODO: We may need to incorporate similar logic for macOS: https://github.com/vim/vim/blob/0cdb72aa38c4a0140c94d56bf8bc17cb30260ebf/src/misc1.c#L4287-L4308
* refactor: eliminate misc2.cJustin M. Keyes2016-09-13
| | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* os/env.c: document remove_tail() properlyFelipe Oliveira Carvalho2016-05-15
|
* os/env.c: declare srcp and dst as restrict in expand_env_esc()Felipe Oliveira Carvalho2016-05-15
| | | | | | | | | | | ...and small refactorings: - Style changes - Variable renames - Changes in variable scope This change won't bring new problems (undefined behavior) as `memcpy` is already being used in the function.
* os/env.c: cosmetic changes done during review of the fileFelipe Oliveira Carvalho2016-05-15
|
* Merge pull request #4277 from Jun-T/lang2localeJustin M. Keyes2016-02-26
|\ | | | | build: install *.mo into the "standard" directory
| * build: install *.mo into the "standard" directoryJun T2016-02-23
| | | | | | | | | | | | | | Change POROJECT_NAME to 'nvim', and use it as the gettext domain name. The *.mo files, previously installed as $runtime/lang/xx/LC_MESSAGES/nvim.mo, are now installed as $prefix/locale/xx/LC_MESSAGES/nvim.mo.
* | vim-patch:7.4.845watiko2016-02-21
| | | | | | | | | | | | | | Problem: Compiler warning for possible loss of data. Solution: Add a type cast. (Erich Ritz) https://github.com/vim/vim/commit/5df1ed2de3fa9dcace996b9a0a4c9b3cea79cf1e
* | vim-patch:7.4.832watiko2016-02-21
|/ | | | | | | | | | | | | | | Problem: $HOME in `=$HOME . '/.vimrc'` is expanded too early. Solution: Skip over `=expr` when expanding environment names. https://github.com/vim/vim/commit/be83b73ddb2ee8297037166d243f72e3423a3ce3 --- To reproduce: ```sh nvim -u NONE -c 'e `=$HOME . "/.vimrc"`' ```
* misc: UNIX => Unix #4022Seth Jackson2016-01-16
| | | | | | | | | | Although UNIX is a registered trademark of The Open Group, it doesn't really matter whether we refer to these systems as UNIX, Unix, or Unix-like. So, for consistency, refer to them collectively as Unix. Related: http://www.greens.org/about/unix.html http://www.unixica.com/html/unixunix.html
* doc: Remove more references to MS-DOSSeth Jackson2016-01-16
| | | | | | Among other things, this includes: - lies about command.com - references to pcterm
* Windows: Implement os_setenv() using _putenv_s()Rui Abreu Ferreira2015-12-12
| | | | | | | | | Windows does not have setenv(), instead the _putenv_s() function is used - added a function check and fatal errors. Implemented os_setenv() for Windows. Vim supports the original putenv() function if no alternative is available. Neovim only supports systems where safer alternatives exist, so the check for putenv() was removed from config/CMakeLists.txt.
* Windows: Define HOME environment variableRui Abreu Ferreira2015-12-08
| | | | | | - Bring back Vim code for settings $HOME in Windows from $HOMEDRIVE$HOMEPATH - vim-patch:0
* main,os/env: Fix lint errorsZyX2015-10-23
|
* os/env: Add functions that can iterate over colon-separated variablesZyX2015-10-23
|
* getenv: return NULL if empty #2574Scott Prager2015-05-29
| | | | | | Making an environment variable empty can be a way of unsetting it for platforms that don't support unsetenv(). In most cases, we treat empty variables as having been unset. For all others, use os_env_exists().
* Merge 'p' declaration with init in vim_version_dir()Mark Bainter2015-05-06
|
* Remove char_u: concat_fnames()Mark Bainter2015-05-06
|
* Enable -Wconversion: normal.c.Eliseo Martínez2015-04-27
| | | | | | | | | | | | | | | | | | | | | | | | Refactor summary: - extern int opcount --> extern long opcount - bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...) * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...) - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...) - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen) * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...) - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen) - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...) - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp) * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...) - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len) - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...) * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...) - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...) * int spell_move_to(...) --> size_t spell_move_to(...) - int spell_check(...) --> size_t spell_check(...) - static int spell_bad_len --> static size_t spell_bad_len - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...) Helped-by: Justin M. Keyes <justinkz@gmail.com>
* Refactor get_env() to respect const qualifierMark Bainter2015-04-18
| | | | | | Without the casts*, the compiler rightly warns about the os_getenv losing the qualifier. This refactor adds a variable to manage this properly, and renames the original variables to increase clarity.
* Remove char_u: vim_setenv()Mark Bainter2015-04-18
|
* Remove char_u: vim_getenv()Mark Bainter2015-04-17
|
* Remove char_u: after_pathstep()Mark Bainter2015-04-17
| | | | See: #459
* Implement os_unsetenv()Rui Abreu Ferreira2015-04-14
| | | | | | | - In UNIX systems where unsetenv() is available, it is used. Otherwise the variables are set with the empty string. - New check HAVE_UNSETENV for unsetenv() - Added unit test to env_spec.lua
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* remove char_u: vim_version_dir #2414Mark Bainter2015-04-12
| | | | See: #459
* refactor remove_tail() function to no longer use char_u #2413Mark Bainter2015-04-12
| | | | See #459
* Refactor default_vim{,runtime}_dir to use char type. #2375Mark Bainter2015-04-12
| | | | | | See: #459 Reviewed-by: Justin M. Keyes <justinkz@gmail.com> Reviewed-by: Eliseo Martínez <eliseomarmol@gmail.com>
* Remove potential NULL dereference. #2316Prajjwal Bhandari2015-03-31
| | | | | | This also removes the `#elseif defined(MSWIN)` clause. Due to the enclosing `if` block, we will never get to this point when src starts with a '%', making the whole #elseif block dead code.
* refactor: split some more functions from misc1.cbobtwinkles2015-03-24
| | | | | | | | | | | This commit pulls the some environment-variable handling functions out of misc1.c and in to os/env.c. Previously submited as #1231, this is the start of a patch series that does that work based on a more up-to-date master branch. Major tasks accomplished: - move functions and fix includes - fix clint/clang analysis warnings - correct documentation comments
* strings: Enable -Wconvert.Scott Prager2014-11-27
|
* Use strict function prototypes #945Pavel Platto2014-07-14
| | | | | | | | | | | | | | | | | | | `-Wstrict-prototypes` warn if a function is declared or defined without specifying the argument types. This warning disallow function prototypes with empty parameter list. In C, a function declared with an empty parameter list accepts an arbitrary number of arguments when being called. This is for historic reasons; originally, C functions didn't have prototypes, as C evolved from B, a typeless language. When prototypes were added, the original typeless declarations were left in the language for backwards compatibility. Instead we should provide `void` in argument list to state that function doesn't have arguments. Also this warning disallow declaring type of the parameters after the parentheses because Neovim header generator produce no declarations for old-stlyle prototypes: it expects to find `{` after prototype.
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* spelling fixes #827Will Stamper2014-06-12
|