On Tue, Oct 02, 2012 at 09:32:11PM +0200, Carlos Martín Nieto wrote:
> >> @@ -101,8 +102,9 @@ static char *locate_in_PATH(const char *file)
> >>}
> >>strbuf_addstr(&buf, file);
> >>
> >> - if (!access(buf.buf, F_OK))
> >> + if (!stat(buf.buf, &st) && !S_
c...@elego.de (Carlos Martín Nieto) writes:
> How about something like this instead? We keep the access check and only
> do the stat call when we have found something we want to look at.
Sounds safer.
Looking at the way the stat call is indented twice, I suspect that
the variable can be defined
Junio C Hamano writes:
> Carlos Martín Nieto writes:
>
>> When looking through $PATH to try to find an external command,
>> locate_in_PATH doesn't check that it's trying to execute a file. Add a
>> check to make sure we won't try to execute a directory.
>>
>> This also stops us from looking furt
Carlos Martín Nieto writes:
> When looking through $PATH to try to find an external command,
> locate_in_PATH doesn't check that it's trying to execute a file. Add a
> check to make sure we won't try to execute a directory.
>
> This also stops us from looking further and maybe finding that the
>
When looking through $PATH to try to find an external command,
locate_in_PATH doesn't check that it's trying to execute a file. Add a
check to make sure we won't try to execute a directory.
This also stops us from looking further and maybe finding that the
user meant an alias, as in the case where
5 matches
Mail list logo