Skip to content

Commit 7d08e7f

Browse files
authored
Patch toml_error (#1011)
2 parents 7dc0171 + 9dd4487 commit 7d08e7f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/fpm/toml.f90

+7-7
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ subroutine load_from_unit(self, unit, error, json)
256256
!> Optional JSON format
257257
logical, optional, intent(in) :: json
258258

259-
type(toml_error), allocatable :: toml_error
259+
type(toml_error), allocatable :: local_error
260260
type(toml_table), allocatable :: table
261261
type(toml_table), pointer :: jtable
262262
class(toml_value), allocatable :: object
@@ -267,10 +267,10 @@ subroutine load_from_unit(self, unit, error, json)
267267
if (is_json) then
268268

269269
!> init JSON interpreter
270-
call json_load(object, unit, error=toml_error)
271-
if (allocated(toml_error)) then
270+
call json_load(object, unit, error=local_error)
271+
if (allocated(local_error)) then
272272
allocate (error)
273-
call move_alloc(toml_error%message, error%message)
273+
call move_alloc(local_error%message, error%message)
274274
return
275275
end if
276276

@@ -286,11 +286,11 @@ subroutine load_from_unit(self, unit, error, json)
286286
else
287287

288288
!> use default TOML parser
289-
call toml_load(table, unit, error=toml_error)
289+
call toml_load(table, unit, error=local_error)
290290

291-
if (allocated(toml_error)) then
291+
if (allocated(local_error)) then
292292
allocate (error)
293-
call move_alloc(toml_error%message, error%message)
293+
call move_alloc(local_error%message, error%message)
294294
return
295295
end if
296296

0 commit comments

Comments
 (0)