Build an executable name with suffix. Safe routine that always returns an allocated string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(srcfile_t), | intent(in) | :: | source |
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