summaryrefslogtreecommitdiffstats
path: root/gitweb/static/js/javascript-detection.js
diff options
context:
space:
mode:
authorKarsten Blees <karsten.blees@gmail.com>2026-01-09 20:04:58 +0000
committerJunio C Hamano <gitster@pobox.com>2026-01-09 18:32:54 -0800
commit3b96b99683679ee0d0c4e05cb5d1da37e13e02e5 (patch)
tree3476dd26681815260a0221ecde6a984e2f2bdd57 /gitweb/static/js/javascript-detection.js
parentec13dca8d0619dc1cfe4cee5801b32bc58792ae2 (diff)
downloadgit-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