diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-02-26 16:16:53 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-02-26 16:16:53 +0100 |
commit | b3f740695a0199d22cd97aee314f06c7ae32d2ea (patch) | |
tree | 8221662bb578d80a7a044f8a20aef09394a5a1a8 /src/misc1.c | |
parent | d672dde584effd55702ee15efec4cb2a8c77bf85 (diff) | |
download | vim-git-b3f740695a0199d22cd97aee314f06c7ae32d2ea.tar.gz |
patch 8.2.0320: no Haiku supportv8.2.0320
Problem: No Haiku support.
Solution: Add support for Haiku. (Emir Sari, closes #5605)
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c index 635b87be2..80aefd812 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -14,6 +14,10 @@ #include "vim.h" #include "version.h" +#if defined(__HAIKU__) +# include <storage/FindDirectory.h> +#endif + #if defined(MSWIN) # include <lm.h> #endif @@ -1667,6 +1671,18 @@ vim_getenv(char_u *name, int *mustfree) // handling $VIMRUNTIME and $VIM is below, bail out if it's another name. vimruntime = (STRCMP(name, "VIMRUNTIME") == 0); if (!vimruntime && STRCMP(name, "VIM") != 0) +#if defined(__HAIKU__) + // special handling for user settings directory... + if (STRCMP(name, "BE_USER_SETTINGS") == 0) + { + static char userSettingsPath[MAXPATHL] = {0}; + + if (B_OK == find_directory(B_USER_SETTINGS_DIRECTORY, 0, + false, userSettingsPath, MAXPATHL)) + return userSettingsPath; + } + else +#endif return NULL; /* |