Skip to content

Commit 6b7adb1

Browse files
update detectwsl
add a case to regex when wsl or microsoft exists inside a word Co-authored-by: Stefan Karpinski <stefan@karpinski.org>
1 parent b8518ba commit 6b7adb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/sysinfo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ Runtime Predicate for testing if Julia is running inside WSL.
420420
function detectwsl(os::Symbol)
421421
islinux(os) &&
422422
isfile("/proc/sys/kernel/osrelease") &&
423-
contains(read("/proc/sys/kernel/osrelease", String), r"Microsoft|WSL"i)
423+
contains(read("/proc/sys/kernel/osrelease", String), r"\b(Microsoft|WSL)\b"i)
424424
end
425425

426426
for f in (:detectwsl, :isunix, :islinux, :isbsd, :isapple, :iswindows, :isfreebsd, :isopenbsd, :isnetbsd, :isdragonfly, :isjsvm)

0 commit comments

Comments
 (0)