Skip to content

Commit 51fe318

Browse files
committed
update fortran-shlex to 2.0.0 (mslex)
1 parent 36890b8 commit 51fe318

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

fpm.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fortran-regex.tag = "1.1.2"
2121
jonquil.git = "https://github.com/toml-f/jonquil"
2222
jonquil.rev = "4fbd4cf34d577c0fd25e32667ee9e41bf231ece8"
2323
fortran-shlex.git = "https://github.com/perazz/fortran-shlex"
24-
fortran-shlex.tag = "1.2.1"
24+
fortran-shlex.tag = "2.0.0"
2525

2626
[[test]]
2727
name = "cli-test"

src/fpm_compile_commands.F90

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module fpm_compile_commands
77
use fpm_strings, only: string_t, operator(==)
88
use fpm_error, only: error_t, syntax_error, fatal_error
99
use fpm_os, only: get_current_directory
10-
use shlex_module, only: shlex_split => split
10+
use fpm_environment, only: get_os_type, OS_WINDOWS
11+
use shlex_module, only: sh_split => split, ms_split
1112
implicit none
1213

1314
!> Definition of a build command
@@ -249,7 +250,11 @@ subroutine cct_register(self, command, error)
249250
end if
250251

251252
! Tokenize the input command into args(:)
252-
args = shlex_split(command, join_spaced=.false., keep_quotes=.true., success=sh_success)
253+
if (get_os_type()==OS_WINDOWS) then
254+
args = ms_split(command, ucrt=.true., success=sh_success)
255+
else
256+
args = sh_split(command, join_spaced=.false., keep_quotes=.true., success=sh_success)
257+
end if
253258
n = size(args)
254259

255260
if (n==0 .or. .not.sh_success) then

src/fpm_compiler.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module fpm_compiler
4646
use tomlf, only: toml_table
4747
use fpm_toml, only: serializable_t, set_string, set_value, toml_stat, get_value
4848
use fpm_compile_commands, only: compile_command_t, compile_command_table_t
49-
use shlex_module, only: shlex_split => split
49+
use shlex_module, only: sh_split => split, ms_split
5050
implicit none
5151
public :: compiler_t, new_compiler, archiver_t, new_archiver, get_macros
5252
public :: append_clean_flags, append_clean_flags_array
@@ -1693,7 +1693,7 @@ subroutine tokenize_flags(flags, flags_array)
16931693
integer :: i
16941694
logical :: success
16951695

1696-
flags_char_array = shlex_split(flags, join_spaced=.true., keep_quotes=.true., success=success)
1696+
flags_char_array = sh_split(flags, join_spaced=.true., keep_quotes=.true., success=success)
16971697
if (.not. success) then
16981698
allocate(flags_array(0))
16991699
return

0 commit comments

Comments
 (0)