Skip to content

Commit

Permalink
toml set_character interface: work with allocatable and non-allocat…
Browse files Browse the repository at this point in the history
…able input strings
  • Loading branch information
perazz committed Mar 26, 2024
1 parent 64093b1 commit d5f9b46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fpm/toml.f90
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ subroutine set_character(table, key, var, error, whereAt)
character(len=*), intent(in) :: key

!> The character variable
character(len=:), allocatable, intent(in) :: var
character(len=*), optional, intent(in) :: var

!> Error handling
type(error_t), allocatable, intent(out) :: error
Expand All @@ -471,7 +471,7 @@ subroutine set_character(table, key, var, error, whereAt)
return
end if

if (allocated(var)) then
if (present(var)) then
call set_value(table, key, var, ierr)
if (ierr/=toml_stat%success) then
call fatal_error(error,'cannot set character key <'//key//'> in TOML table')
Expand Down

0 comments on commit d5f9b46

Please sign in to comment.