libiberty: fix running extension-less binaries on windows

Vladimir Prus vladimir@codesourcery.com
Sat Nov 4 10:10:00 GMT 2006


DJ Delorie wrote:

> 
> I think it's better to search for the last / or \ in the program, then
> look for '.' after that.  You have to be careful about running "foo"
> when both "foo" and "foo.exe" exist - it may try to run the first as a
> COM file and crash.

Is it common to have both "foo" and "foo.exe", the first being a COM file? I
don't think I saw a COM file in year ;-)

Also, does it mean we should try the ".exe" extension before the ".com"
extension?

> An alternate idea is to put the "" extension at the end of the list,
> or at least after ".exe".

I'd prefer this approach.

Thanks,
Volodya







More information about the Gcc-patches mailing list