diff src/misc1.c @ 19526:22f0dda71638 v8.2.0320

patch 8.2.0320: no Haiku support Commit: https://github.com/vim/vim/commit/b3f740695a0199d22cd97aee314f06c7ae32d2ea Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 26 16:16:53 2020 +0100 patch 8.2.0320: no Haiku support Problem: No Haiku support. Solution: Add support for Haiku. (Emir Sari, closes https://github.com/vim/vim/issues/5605)
author Bram Moolenaar <Bram@vim.org>
date Wed, 26 Feb 2020 16:30:04 +0100
parents a961efb326e5
children 41a1ea967a97
line wrap: on
line diff
--- 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;
 
     /*