diff options
| author | Karsten Blees <karsten.blees@gmail.com> | 2026-01-09 20:04:58 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-01-09 18:32:54 -0800 |
| commit | 3b96b99683679ee0d0c4e05cb5d1da37e13e02e5 (patch) | |
| tree | 3476dd26681815260a0221ecde6a984e2f2bdd57 /gitweb/static/js/javascript-detection.js | |
| parent | ec13dca8d0619dc1cfe4cee5801b32bc58792ae2 (diff) | |
| download | git-3b96b99683679ee0d0c4e05cb5d1da37e13e02e5.tar.gz git-3b96b99683679ee0d0c4e05cb5d1da37e13e02e5.zip | |
mingw: don't call `GetFileAttributes()` twice in `mingw_lstat()`
The Win32 API function `GetFileAttributes()` cannot handle paths with
trailing dir separators. The current `mingw_stat()`/`mingw_lstat()`
implementation calls `GetFileAttributes()` twice if the path has
trailing slashes (first with the original path that was passed as
function parameter, and and a second time with a path copy with trailing
'/' removed).
With the conversion to wide Unicode, we get the length of the path for
free, and also have a (wide char) buffer that can be modified. This
makes it easy to avoid that extraneous Win32 API call.
Signed-off-by: Karsten Blees <karsten.blees@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/static/js/javascript-detection.js')
0 files changed, 0 insertions, 0 deletions
