diff src/os_win32.c @ 25084:beff72446e2e v8.2.3079

patch 8.2.3079: Powershell core not supported by default Commit: https://github.com/vim/vim/commit/a3d1b29bd36487167c98b3cefa30f06c529e412d Author: Mike Williams <mikew@globalgraphics.com> Date: Wed Jun 30 20:56:00 2021 +0200 patch 8.2.3079: Powershell core not supported by default Problem: Powershell core not supported by default. Solution: Set option defaults for "pwsh". (Mike Williams, closes https://github.com/vim/vim/issues/8481)
author Bram Moolenaar <Bram@vim.org>
date Wed, 30 Jun 2021 21:00:05 +0200
parents 0ce24f734615
children c4298ed56ffa
line wrap: on
line diff
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -2135,6 +2135,7 @@ executable_exists(char *name, char_u **p
     char_u	*pathbuf = NULL;
     char_u	*pathext = NULL;
     char_u	*pathextbuf = NULL;
+    char_u	*shname = NULL;
     int		noext = FALSE;
     int		retval = FALSE;
 
@@ -2142,8 +2143,10 @@ executable_exists(char *name, char_u **p
 	return FALSE;
 
     // Using the name directly when a Unix-shell like 'shell'.
-    if (strstr((char *)gettail(p_sh), "powershell") == NULL
-				&& strstr((char *)gettail(p_sh), "sh") != NULL)
+    shname = gettail(p_sh);
+    if (strstr((char *)shname, "sh") != NULL &&
+	!(strstr((char *)shname, "powershell") != NULL
+				    || strstr((char *)shname, "pwsh") != NULL))
 	noext = TRUE;
 
     if (use_pathext)