argv[0] handling

Alex Waugh alex at alexwaugh.com
Tue Jun 14 06:11:52 PDT 2005


Theo Markettos wrote:
> On Tue, Jun 14, 2005 at 01:26:52PM +0100, Alex Waugh wrote:
>>I think canonicalising it if it contains any . : < > $ characters, 
>>otherwise leaving it as it is, should be good enough for most cases.
> 
> 
> The aliases case above makes that a little more dangerous: what does
> exec("cat") do?  (which could exist as a built in *command, an alias and an
> executable all at the same time).  What about exec(".")?

exec calls OS_CLI which will then expand the alias and pass the expanded 
command to the child via OS_GetEnv.

Alex

-- 
Alex Waugh                                           alex at alexwaugh.com

PHP, Roots, Subversion, WebJames and more from http://www.alexwaugh.com/





More information about the gcc mailing list