diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2024-09-01 13:01:24 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-01 13:01:24 -0700 |
| commit | 61e9137394fc5229e582a64316c2ffef55d8d7af (patch) | |
| tree | c0f380b5efa26bed8c13d2d7b192c0c89568222a /src/nvim/os | |
| parent | 6913c5e1d975a11262d08b3339d50b579e6b6bb8 (diff) | |
| download | rneovim-61e9137394fc5229e582a64316c2ffef55d8d7af.tar.gz rneovim-61e9137394fc5229e582a64316c2ffef55d8d7af.tar.bz2 rneovim-61e9137394fc5229e582a64316c2ffef55d8d7af.zip | |
docs: misc #28970
Diffstat (limited to 'src/nvim/os')
| -rw-r--r-- | src/nvim/os/env.c | 30 | ||||
| -rw-r--r-- | src/nvim/os/input.c | 2 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index a4d5c02b5b..8dfedd073e 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -395,7 +395,21 @@ void os_get_hostname(char *hostname, size_t size) #endif } -/// To get the "real" home directory: +/// The "real" home directory as determined by `init_homedir`. +static char *homedir = NULL; +static char *os_uv_homedir(void); + +/// Gets the "real", resolved user home directory as determined by `init_homedir`. +const char *os_homedir(void) +{ + if (!homedir) { + emsg("os_homedir failed: homedir not initialized"); + return NULL; + } + return homedir; +} + +/// Sets `homedir` to the "real", resolved user home directory, as follows: /// 1. get value of $HOME /// 2. if $HOME is not set, try the following /// For Windows: @@ -409,20 +423,6 @@ void os_get_hostname(char *hostname, size_t size) /// This also works with mounts and links. /// Don't do this for Windows, it will change the "current dir" for a drive. /// 3. fall back to current working directory as a last resort -static char *homedir = NULL; -static char *os_uv_homedir(void); - -/// Public accessor for the cached "real", resolved user home directory. See -/// comment on `homedir`. -const char *os_get_homedir(void) -{ - if (!homedir) { - emsg("os_get_homedir failed: homedir not initialized"); - return NULL; - } - return homedir; -} - void init_homedir(void) { // In case we are called a second time. diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index c4eb2803f6..8affc58591 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -514,7 +514,7 @@ static void process_ctrl_c(void) size_t available = input_available(); ssize_t i; - for (i = (ssize_t)available - 1; i >= 0; i--) { + for (i = (ssize_t)available - 1; i >= 0; i--) { // Reverse-search input for Ctrl_C. uint8_t c = (uint8_t)input_read_pos[i]; if (c == Ctrl_C || (c == 'C' && i >= 3 |