If a filename is passed to the function SysSearchPath without an extension, but WITH a trailing dot, the function will return the filename WITHOUT the trailing dot (provided, of course, that the file exists); e.g.:
newName = SysSearchpath( 'PATH', 'test.' )
returns C:\test if that file exists (and C:\ is in the PATH variable).