From c10ba6d81a3c696fc90fe0deac89006407faba01 Mon Sep 17 00:00:00 2001 From: Wertzui123 <46199283+Wertzui123@users.noreply.github.com> Date: Thu, 23 Jun 2022 19:12:29 +0200 Subject: [PATCH] os: add `.cmd` to the list of Windows executable suffixes (#14839) --- vlib/os/os.c.v | 2 +- vlib/os/os_windows.c.v | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/os/os.c.v b/vlib/os/os.c.v index 8c1986288c..5197065768 100644 --- a/vlib/os/os.c.v +++ b/vlib/os/os.c.v @@ -404,7 +404,7 @@ pub fn is_executable(path string) bool { // 04 Read-only // 06 Read and write p := real_path(path) - return exists(p) && (p.ends_with('.exe') || p.ends_with('.bat')) + return exists(p) && (p.ends_with('.exe') || p.ends_with('.bat') || p.ends_with('.cmd')) } $if solaris { statbuf := C.stat{} diff --git a/vlib/os/os_windows.c.v b/vlib/os/os_windows.c.v index 9a9d1811e0..e0c1bf52a4 100644 --- a/vlib/os/os_windows.c.v +++ b/vlib/os/os_windows.c.v @@ -14,7 +14,7 @@ fn C.CreateHardLinkW(&u16, &u16, C.SECURITY_ATTRIBUTES) int fn C._getpid() int -const executable_suffixes = ['.exe', '.bat', ''] +const executable_suffixes = ['.exe', '.bat', '.cmd', ''] pub const ( path_separator = '\\'