os: add `.cmd` to the list of Windows executable suffixes (#14839)

master
Wertzui123 2022-06-23 19:12:29 +02:00 committed by GitHub
parent b0fe21f018
commit c10ba6d81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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{}

View File

@ -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 = '\\'