Windows: Make 'git help -a' work.
commitdfd188ababfd634c4cc2a18f6ed38c3829e5058c
authorJohannes Sixt <johannes.sixt@telecom.at>
Mon, 14 Jan 2008 13:05:33 +0000 (14 14:05 +0100)
committerJohannes Sixt <johannes.sixt@telecom.at>
Mon, 14 Jan 2008 13:35:52 +0000 (14 14:35 +0100)
treec3457a5243e3a1684a75529d061e550d51c8e2fc
parent9b4b9da619e4bcb25eb581ddb73ff628cc97ac95
Windows: Make 'git help -a' work.

git help -a scans the PATH for git commands. On Windows it failed for two
reasons:

- The PATH separator is ';', not ':' on Windows.

- stat() does not set the executabe bit.

We now open the file and guess whether it is executable.

The result of the guess is good enough for the list of git commands, but
it is of no use for a general stat() implementation because (1) it is a
guess, (2) the user has no way to influence the outcome (via chmod or
similar), and (3) it would reduce stat() performance by an unacceptable
amount. Therefore, this strategy is a special-case local to help.c.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
help.c