Re: [review] XM_CATALOG_BOOTSTRAP_RESOLVER.Reserved_directory_path is not safe

Eric Bezault <[email protected]> Fri, 23 Jan 2009 22:42:01 +0100
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
Jocelyn wrote:
> In the code of {XM_CATALOG_BOOTSTRAP_RESOLVER}.Reserved_directory_path
> we have
>             Result := Execution_environment.variable_value ("GOBO")
>             Result := unix_file_system.pathname_from_file_system
> (Result, file_system)
> 
> However `Execution_environment.variable_value ("GOBO")' can return a
> Void value
> and then the call to unix_file_system.pathname_from_file_system (Result,
> file_system) will violate precondition of  `pathname_from_file_system'
> or raise exception (if assertion are disabled).

I modified it as follows:

	Reserved_directory_path: STRING is
			-- Path to directory containing latest schemas
		once
			Result := file_system.pathname ("${GOBO}", "misc")
			Result := Execution_environment.interpreted_string (Result)
		ensure
			reserved_directory_path_not_void: Result /= Void
		end

Note that it looks like this routine is never called.

-- 
Eric Bezault
mailto:[email protected]
http://www.gobosoft.com

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword