diff options
author | René Scharfe <l.s.r@web.de> | 2017-05-20 21:35:37 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-23 21:44:38 +0900 |
commit | e0ca1ca20a0bde51c4eb9242dd9521ac1ed08304 (patch) | |
tree | 61829780d3ba705b1720148837328c385250fac9 /mailinfo.h | |
parent | 10c78a162fa821ee85203165b805ff46be454091 (diff) | |
download | git-e0ca1ca20a0bde51c4eb9242dd9521ac1ed08304.tar.gz |
mingw: simplify PATH handlingrs/mingw-path-lookup-simplify
On Windows the environment variable PATH contains a semicolon-separated
list of directories to search for, in order, when looking for the
location of a binary to run. get_path_split() parses it and returns an
array of string copies, which is iterated by path_lookup(), which in
turn passes each entry to lookup_prog().
Change lookup_prog() to take the directory name as a length-limited
string instead of as a NUL-terminated one and parse PATH directly in
path_lookup(). This avoids memory allocations, simplifying the code.
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mailinfo.h')
0 files changed, 0 insertions, 0 deletions