git-commit-vandalism/compat/win32
Andras Kucsma 05ac8582bc run-command: trigger PATH lookup properly on Cygwin
On Cygwin, the codepath for POSIX-like systems is taken in
run-command.c::start_command(). The prepare_cmd() helper
function is called to decide if the command needs to be looked
up in the PATH. The logic there is to do the PATH-lookup if
and only if it does not have any slash '/' in it. If this test
passes we end up attempting to run the command by appending the
string after each colon-separated component of PATH.

The Cygwin environment supports both Windows and POSIX style
paths, so both forwardslahes '/' and back slashes '\' can be
used as directory separators for any external program the user
supplies.

Examples for path strings which are being incorrectly searched
for in the PATH instead of being executed as is:

- "C:\Program Files\some-program.exe"
- "a\b\c.exe"

To handle these, the PATH lookup detection logic in prepare_cmd()
is taught to know about this Cygwin quirk, by introducing
has_dir_sep(path) helper function to abstract away the difference
between true POSIX and Cygwin systems.

Signed-off-by: Andras Kucsma <r0maikx02b@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-27 11:06:17 -07:00
..
alloca.h mingw: activate alloca 2014-04-09 10:08:35 -07:00
dirent.c Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
dirent.h Win32: Unicode file name support (dirent) 2014-07-15 11:19:09 -07:00
git.manifest mingw: embed a manifest to trick UAC into Doing The Right Thing 2019-06-27 12:55:45 -07:00
lazyload.h Win32: simplify loading of DLL functions 2017-09-26 11:02:49 +09:00
path-utils.c Sync with 2.20.2 2019-12-06 16:31:12 +01:00
path-utils.h run-command: trigger PATH lookup properly on Cygwin 2020-03-27 11:06:17 -07:00
pthread.c win32: replace pthread_cond_*() with much simpler code 2018-11-14 15:14:22 +09:00
pthread.h pthread.h: manually align parameter lists 2019-10-11 14:59:35 +09:00
syslog.c win32: plug memory leak on realloc() failure in syslog() 2017-08-10 13:57:52 -07:00
syslog.h mingw: implement syslog 2010-11-04 16:53:49 -07:00
trace2_win32_process_info.c trace2: report peak memory usage of the process 2019-04-16 13:37:07 +09:00