Re: [AD] [AL] get_executable_name in xsystem.c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


George  wrote:
> run a program by typing "foo", and the executable would be the
> one in my path, not the random file called `foo' in the current
> directory.

But this would not be a problem. 
The only way you could execute a program called 'foo' in the current
directory is when the current directory is first in the path.

(or you could explicitly call ./foo, in which case argv[0] would contain a /)

If this were a problem the 'which' program would not work.

So as long as we search the path in the correct order, there
should be no problem here.

Martijn Versteegh



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/