get_exe_name_with_suffix Function

public function get_exe_name_with_suffix(source) result(suffixed)

Build an executable name with suffix. Safe routine that always returns an allocated string

Arguments

Type IntentOptional Attributes Name
type(srcfile_t), intent(in) :: source

Return Value character(len=:), allocatable


Source Code

function get_exe_name_with_suffix(source) result(suffixed)
    type(srcfile_t), intent(in) :: source
    character(len=:), allocatable :: suffixed

    if (allocated(source%exe_name)) then
       if (get_os_type() == OS_WINDOWS) then
           suffixed = source%exe_name//'.exe'
       else
           suffixed = source%exe_name
       end if
    else
       suffixed = ""
    endif

end function get_exe_name_with_suffix