need to check at the beginning

wrong logic in case default was overwritten
This commit is contained in:
Martin Diehl 2018-06-26 19:09:08 +02:00
parent 92bcf3a7aa
commit 6a75021bca
1 changed files with 4 additions and 3 deletions

View File

@ -450,6 +450,9 @@ character(len=65536) function getString(this,key,defaultVal,raw)
whole = merge(raw,.false.,present(raw)) ! whole string or white space splitting
found = present(defaultVal)
if (found) getString = trim(defaultVal)
if (found) then
if (len_trim(getString) /= len_trim(defaultVal)) call IO_error(0_pInt,ext_msg='getString')
endif
item => this%next
do while (associated(item))
@ -467,9 +470,7 @@ character(len=65536) function getString(this,key,defaultVal,raw)
end do
if (.not. found) call IO_error(140_pInt,ext_msg=key)
if (present(defaultVal)) then
if (len_trim(getString) /= len_trim(defaultVal)) call IO_error(0_pInt,ext_msg='getString')
endif
end function getString