Skip to content

Commit d5f9b46

Browse files
committed
toml set_character interface: work with allocatable and non-allocatable input strings
1 parent 64093b1 commit d5f9b46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fpm/toml.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ subroutine set_character(table, key, var, error, whereAt)
454454
character(len=*), intent(in) :: key
455455

456456
!> The character variable
457-
character(len=:), allocatable, intent(in) :: var
457+
character(len=*), optional, intent(in) :: var
458458

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

474-
if (allocated(var)) then
474+
if (present(var)) then
475475
call set_value(table, key, var, ierr)
476476
if (ierr/=toml_stat%success) then
477477
call fatal_error(error,'cannot set character key <'//key//'> in TOML table')

0 commit comments

Comments
 (0)