From 6a75021bcad82a0863002a2900f0e658f023c8de Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 Jun 2018 19:09:08 +0200 Subject: [PATCH] need to check at the beginning wrong logic in case default was overwritten --- src/config.f90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config.f90 b/src/config.f90 index 6c53dc5e4..288e9d4c7 100644 --- a/src/config.f90 +++ b/src/config.f90 @@ -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