Skip to content

Commit 47b49ec

Browse files
authored
fpm_environment: lower windows check precedence in get_os_type function (#802)
1 parent b0f55f0 commit 47b49ec

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/fpm_environment.f90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ integer function get_os_type() result(r)
5151
first_run = .false.
5252
r = OS_UNKNOWN
5353

54-
! Check environment variable `OS`.
55-
call get_environment_variable('OS', val, length, rc)
56-
57-
if (rc == 0 .and. length > 0 .and. index(val, 'Windows_NT') > 0) then
58-
r = OS_WINDOWS
59-
ret = r
60-
return
61-
end if
62-
6354
! Check environment variable `OSTYPE`.
6455
call get_environment_variable('OSTYPE', val, length, rc)
6556

@@ -114,6 +105,15 @@ integer function get_os_type() result(r)
114105
end if
115106
end if
116107

108+
! Check environment variable `OS`.
109+
call get_environment_variable('OS', val, length, rc)
110+
111+
if (rc == 0 .and. length > 0 .and. index(val, 'Windows_NT') > 0) then
112+
r = OS_WINDOWS
113+
ret = r
114+
return
115+
end if
116+
117117
! Linux
118118
inquire (file='/etc/os-release', exist=file_exists)
119119

0 commit comments

Comments
 (0)